[NETFILTER]: Introduce nf_inet_address
[safe/jmp/linux-2.6] / include / linux / netfilter.h
index 0947424..d190d56 100644 (file)
@@ -48,6 +48,12 @@ enum nf_inet_hooks {
        NF_INET_NUMHOOKS
 };
 
+union nf_inet_addr {
+       u_int32_t       all[4];
+       __be32          ip;
+       __be32          ip6[4];
+};
+
 #ifdef __KERNEL__
 #ifdef CONFIG_NETFILTER
 
@@ -256,11 +262,16 @@ extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *);
 static inline void
 nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family)
 {
-#if defined(CONFIG_IP_NF_NAT_NEEDED) || defined(CONFIG_NF_NAT_NEEDED)
+#ifdef CONFIG_NF_NAT_NEEDED
        void (*decodefn)(struct sk_buff *, struct flowi *);
 
-       if (family == AF_INET && (decodefn = ip_nat_decode_session) != NULL)
-               decodefn(skb, fl);
+       if (family == AF_INET) {
+               rcu_read_lock();
+               decodefn = rcu_dereference(ip_nat_decode_session);
+               if (decodefn)
+                       decodefn(skb, fl);
+               rcu_read_unlock();
+       }
 #endif
 }