]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
netfilter: nf_conntrack: pass template to l4proto ->error() handler
authorPatrick McHardy <kaber@trash.net>
Mon, 15 Feb 2010 16:45:08 +0000 (17:45 +0100)
committerPatrick McHardy <kaber@trash.net>
Mon, 15 Feb 2010 16:45:08 +0000 (17:45 +0100)
The error handlers might need the template to get the conntrack zone
introduced in the next patches to perform a conntrack lookup.

Signed-off-by: Patrick McHardy <kaber@trash.net>
include/net/netfilter/nf_conntrack_l4proto.h
net/ipv4/netfilter/nf_conntrack_proto_icmp.c
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_proto_dccp.c
net/netfilter/nf_conntrack_proto_tcp.c
net/netfilter/nf_conntrack_proto_udp.c
net/netfilter/nf_conntrack_proto_udplite.c

index ca6dcf3445ab50043d469145039c9aa4ccba3b5a..e3d3ee3c06a2cc477fb2b85acf33090a2ef3496e 100644 (file)
@@ -49,8 +49,8 @@ struct nf_conntrack_l4proto {
        /* Called when a conntrack entry is destroyed */
        void (*destroy)(struct nf_conn *ct);
 
-       int (*error)(struct net *net, struct sk_buff *skb, unsigned int dataoff,
-                    enum ip_conntrack_info *ctinfo,
+       int (*error)(struct net *net, struct nf_conn *tmpl, struct sk_buff *skb,
+                    unsigned int dataoff, enum ip_conntrack_info *ctinfo,
                     u_int8_t pf, unsigned int hooknum);
 
        /* Print out the per-protocol part of the tuple. Return like seq_* */
index 7afd39b5b781b1c01ed92f2b35d29aa1ccee64d9..327826a968a8ffe2e11a73f76702abceb8cb6cfb 100644 (file)
@@ -163,7 +163,8 @@ icmp_error_message(struct net *net, struct sk_buff *skb,
 
 /* Small and modified version of icmp_rcv */
 static int
-icmp_error(struct net *net, struct sk_buff *skb, unsigned int dataoff,
+icmp_error(struct net *net, struct nf_conn *tmpl,
+          struct sk_buff *skb, unsigned int dataoff,
           enum ip_conntrack_info *ctinfo, u_int8_t pf, unsigned int hooknum)
 {
        const struct icmphdr *icmph;
index c7b8bd1d7984ed3bb4f782a112c75e738341e9b8..d772dc21857f4f1d9f2107122584189de3b203e3 100644 (file)
@@ -179,7 +179,8 @@ icmpv6_error_message(struct net *net,
 }
 
 static int
-icmpv6_error(struct net *net, struct sk_buff *skb, unsigned int dataoff,
+icmpv6_error(struct net *net, struct nf_conn *tmpl,
+            struct sk_buff *skb, unsigned int dataoff,
             enum ip_conntrack_info *ctinfo, u_int8_t pf, unsigned int hooknum)
 {
        const struct icmp6hdr *icmp6h;
index bd831410a39634044b31be6b6029c284fc1c474e..65351ed5d81515a9462137b54da757b989168d7d 100644 (file)
@@ -799,7 +799,8 @@ nf_conntrack_in(struct net *net, u_int8_t pf, unsigned int hooknum,
         * inverse of the return code tells to the netfilter
         * core what to do with the packet. */
        if (l4proto->error != NULL) {
-               ret = l4proto->error(net, skb, dataoff, &ctinfo, pf, hooknum);
+               ret = l4proto->error(net, tmpl, skb, dataoff, &ctinfo,
+                                    pf, hooknum);
                if (ret <= 0) {
                        NF_CT_STAT_INC_ATOMIC(net, error);
                        NF_CT_STAT_INC_ATOMIC(net, invalid);
index dd375500dccc5315ed723ab9bf5bb8bfb53464a3..9a281554937530d2b2b7817472c95c32586ad18f 100644 (file)
@@ -561,8 +561,9 @@ static int dccp_packet(struct nf_conn *ct, const struct sk_buff *skb,
        return NF_ACCEPT;
 }
 
-static int dccp_error(struct net *net, struct sk_buff *skb,
-                     unsigned int dataoff, enum ip_conntrack_info *ctinfo,
+static int dccp_error(struct net *net, struct nf_conn *tmpl,
+                     struct sk_buff *skb, unsigned int dataoff,
+                     enum ip_conntrack_info *ctinfo,
                      u_int8_t pf, unsigned int hooknum)
 {
        struct dccp_hdr _dh, *dh;
index ad118053971ab27bfe8aa101938258c9e4f3718a..9dd8cd4fb6e64bf1df3c24850c51ac6955d655c8 100644 (file)
@@ -760,7 +760,7 @@ static const u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG) + 1] =
 };
 
 /* Protect conntrack agaist broken packets. Code taken from ipt_unclean.c.  */
-static int tcp_error(struct net *net,
+static int tcp_error(struct net *net, struct nf_conn *tmpl,
                     struct sk_buff *skb,
                     unsigned int dataoff,
                     enum ip_conntrack_info *ctinfo,
index 8d38f9a4bed80e24f609a7717793b595d9508d15..8289088b8218fff057fdf2a2921ceb2bedbb31f2 100644 (file)
@@ -91,8 +91,8 @@ static bool udp_new(struct nf_conn *ct, const struct sk_buff *skb,
        return true;
 }
 
-static int udp_error(struct net *net, struct sk_buff *skb, unsigned int dataoff,
-                    enum ip_conntrack_info *ctinfo,
+static int udp_error(struct net *net, struct nf_conn *tmpl, struct sk_buff *skb,
+                    unsigned int dataoff, enum ip_conntrack_info *ctinfo,
                     u_int8_t pf,
                     unsigned int hooknum)
 {
index 0b1bc9ba66789b23c857e3215320bb41311a3476..263b5a72588d9c5eaa2af6d2601bd97745f472b8 100644 (file)
@@ -89,7 +89,7 @@ static bool udplite_new(struct nf_conn *ct, const struct sk_buff *skb,
        return true;
 }
 
-static int udplite_error(struct net *net,
+static int udplite_error(struct net *net, struct nf_conn *tmpl,
                         struct sk_buff *skb,
                         unsigned int dataoff,
                         enum ip_conntrack_info *ctinfo,