summaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-09-25 15:07:30 -0500
committerPablo Neira Ayuso <pablo@netfilter.org>2015-09-29 20:21:32 +0200
commite45f50660ee5fd38a540afabb7c0f65d063db631 (patch)
treec6ceebc4e52ba3fc18fcccba05ea8870323d6920 /net/ipv4/netfilter.c
parent6a1d689d9f2953975df937be020ae60fa10a73c1 (diff)
downloadblackbird-obmc-linux-e45f50660ee5fd38a540afabb7c0f65d063db631.tar.gz
blackbird-obmc-linux-e45f50660ee5fd38a540afabb7c0f65d063db631.zip
ipv4: Pass struct net into ip_route_me_harder
Don't make ip_route_me_harder guess which network namespace it is routing in, pass the network namespace in. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv4/netfilter.c')
-rw-r--r--net/ipv4/netfilter.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c
index 9e07e6f23398..c3776ff6749f 100644
--- a/net/ipv4/netfilter.c
+++ b/net/ipv4/netfilter.c
@@ -17,9 +17,8 @@
#include <net/netfilter/nf_queue.h>
/* route_me_harder function, used by iptable_nat, iptable_mangle + ip_queue */
-int ip_route_me_harder(struct sk_buff *skb, unsigned int addr_type)
+int ip_route_me_harder(struct net *net, struct sk_buff *skb, unsigned int addr_type)
{
- struct net *net = dev_net(skb_dst(skb)->dev);
const struct iphdr *iph = ip_hdr(skb);
struct rtable *rt;
struct flowi4 fl4 = {};
@@ -116,7 +115,7 @@ static int nf_ip_reroute(struct net *net, struct sk_buff *skb,
skb->mark == rt_info->mark &&
iph->daddr == rt_info->daddr &&
iph->saddr == rt_info->saddr))
- return ip_route_me_harder(skb, RTN_UNSPEC);
+ return ip_route_me_harder(net, skb, RTN_UNSPEC);
}
return 0;
}
OpenPOWER on IntegriCloud