Re: [PATCH 09/25] netns ct: get proper netns from netdevice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alexey Dobriyan wrote:
Get netns from skb->dev on input, from skb->dst->dev on output to know
where to create or search for conntrack.

Is there some documentation re which device accessible from skb is valid
at which point?

For netfilter hooks, skb->dev points to the input device in
PREROUTING, INPUT, FORWARD, to the output device in POSTROUTING
and is invalid in OUTPUT.

@@ -626,10 +628,14 @@ resolve_normal_ct(struct sk_buff *skb,
 		return NULL;
 	}
+ dev = skb->dev;
+	if (!dev)
+		dev = skb->dst->dev;
+	net = dev_net(dev);

Maybe just pass it though nf_conntrack_in from the hook functions,
those get the devices as arguments.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux