ipv4: Push struct net down into nf_send_reset
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 25 Sep 2015 20:07:27 +0000 (15:07 -0500)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 29 Sep 2015 18:21:31 +0000 (20:21 +0200)
This is needed so struct net can be pushed down into
ip_route_me_harder.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/ipv4/nf_reject.h
net/ipv4/netfilter/ipt_REJECT.c
net/ipv4/netfilter/nf_reject_ipv4.c
net/ipv4/netfilter/nft_reject_ipv4.c
net/netfilter/nft_reject_inet.c

index 77862c3645f07000070f94e4838ca8b8cd792110..df7ecd806abaf7d7d2d9417390636df178ae611e 100644 (file)
@@ -6,7 +6,7 @@
 #include <net/icmp.h>
 
 void nf_send_unreach(struct sk_buff *skb_in, int code, int hook);
-void nf_send_reset(struct sk_buff *oldskb, int hook);
+void nf_send_reset(struct net *net, struct sk_buff *oldskb, int hook);
 
 const struct tcphdr *nf_reject_ip_tcphdr_get(struct sk_buff *oldskb,
                                             struct tcphdr *_oth, int hook);
index 87907d4bd259a725cfeea6e4cbccb77be7995972..1d16c0f28df00d17c38a52bfeff23c0a1bca0142 100644 (file)
@@ -59,7 +59,7 @@ reject_tg(struct sk_buff *skb, const struct xt_action_param *par)
                nf_send_unreach(skb, ICMP_PKT_FILTERED, hook);
                break;
        case IPT_TCP_RESET:
-               nf_send_reset(skb, hook);
+               nf_send_reset(par->net, skb, hook);
        case IPT_ICMP_ECHOREPLY:
                /* Doesn't happen. */
                break;
index 3262e41ff76f38a89db3fd7da8c771a51b273abf..fb337406b1d239aa24280400ff59602c7059b8dc 100644 (file)
@@ -99,7 +99,7 @@ void nf_reject_ip_tcphdr_put(struct sk_buff *nskb, const struct sk_buff *oldskb,
 EXPORT_SYMBOL_GPL(nf_reject_ip_tcphdr_put);
 
 /* Send RST reply */
-void nf_send_reset(struct sk_buff *oldskb, int hook)
+void nf_send_reset(struct net *net, struct sk_buff *oldskb, int hook)
 {
        struct sk_buff *nskb;
        const struct iphdr *oiph;
index c1582e03b628f973e667ac06b5506f92be436b2f..c24f41c816b33f22b7e31ffb0b53e963b296f8c1 100644 (file)
@@ -30,7 +30,7 @@ static void nft_reject_ipv4_eval(const struct nft_expr *expr,
                nf_send_unreach(pkt->skb, priv->icmp_code, pkt->hook);
                break;
        case NFT_REJECT_TCP_RST:
-               nf_send_reset(pkt->skb, pkt->hook);
+               nf_send_reset(pkt->net, pkt->skb, pkt->hook);
                break;
        default:
                break;
index 0bc19f97e23888cc880164ceb9e0588ca148ec59..759ca5248a3d22c20ce19dad1b7a7649a4ec0d6f 100644 (file)
@@ -31,7 +31,7 @@ static void nft_reject_inet_eval(const struct nft_expr *expr,
                                        pkt->hook);
                        break;
                case NFT_REJECT_TCP_RST:
-                       nf_send_reset(pkt->skb, pkt->hook);
+                       nf_send_reset(pkt->net, pkt->skb, pkt->hook);
                        break;
                case NFT_REJECT_ICMPX_UNREACH:
                        nf_send_unreach(pkt->skb,