|
@@ -19,25 +19,10 @@
|
|
#include <net/netfilter/nf_conntrack.h>
|
|
#include <net/netfilter/nf_conntrack.h>
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-static struct net *pick_net(struct sk_buff *skb)
|
|
|
|
-{
|
|
|
|
-#ifdef CONFIG_NET_NS
|
|
|
|
- const struct dst_entry *dst;
|
|
|
|
-
|
|
|
|
- if (skb->dev != NULL)
|
|
|
|
- return dev_net(skb->dev);
|
|
|
|
- dst = skb_dst(skb);
|
|
|
|
- if (dst != NULL && dst->dev != NULL)
|
|
|
|
- return dev_net(dst->dev);
|
|
|
|
-#endif
|
|
|
|
- return &init_net;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static bool nf_dup_ipv6_route(struct sk_buff *skb, const struct in6_addr *gw,
|
|
|
|
- int oif)
|
|
|
|
|
|
+static bool nf_dup_ipv6_route(struct net *net, struct sk_buff *skb,
|
|
|
|
+ const struct in6_addr *gw, int oif)
|
|
{
|
|
{
|
|
const struct ipv6hdr *iph = ipv6_hdr(skb);
|
|
const struct ipv6hdr *iph = ipv6_hdr(skb);
|
|
- struct net *net = pick_net(skb);
|
|
|
|
struct dst_entry *dst;
|
|
struct dst_entry *dst;
|
|
struct flowi6 fl6;
|
|
struct flowi6 fl6;
|
|
|
|
|
|
@@ -61,7 +46,7 @@ static bool nf_dup_ipv6_route(struct sk_buff *skb, const struct in6_addr *gw,
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
-void nf_dup_ipv6(struct sk_buff *skb, unsigned int hooknum,
|
|
|
|
|
|
+void nf_dup_ipv6(struct net *net, struct sk_buff *skb, unsigned int hooknum,
|
|
const struct in6_addr *gw, int oif)
|
|
const struct in6_addr *gw, int oif)
|
|
{
|
|
{
|
|
if (this_cpu_read(nf_skb_duplicated))
|
|
if (this_cpu_read(nf_skb_duplicated))
|
|
@@ -81,7 +66,7 @@ void nf_dup_ipv6(struct sk_buff *skb, unsigned int hooknum,
|
|
struct ipv6hdr *iph = ipv6_hdr(skb);
|
|
struct ipv6hdr *iph = ipv6_hdr(skb);
|
|
--iph->hop_limit;
|
|
--iph->hop_limit;
|
|
}
|
|
}
|
|
- if (nf_dup_ipv6_route(skb, gw, oif)) {
|
|
|
|
|
|
+ if (nf_dup_ipv6_route(net, skb, gw, oif)) {
|
|
__this_cpu_write(nf_skb_duplicated, true);
|
|
__this_cpu_write(nf_skb_duplicated, true);
|
|
ip6_local_out(skb);
|
|
ip6_local_out(skb);
|
|
__this_cpu_write(nf_skb_duplicated, false);
|
|
__this_cpu_write(nf_skb_duplicated, false);
|