Commit a4ffe319 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Pablo Neira Ayuso

act_connmark: Remember the struct net instead of guessing it.

Stop guessing the struct net instead of remember it.  Guessing is just
silly and will be problematic in the future when I implement routes
between network namespaces.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 206e8c00
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
struct tcf_connmark_info { struct tcf_connmark_info {
struct tcf_common common; struct tcf_common common;
struct net *net;
u16 zone; u16 zone;
}; };
......
...@@ -74,7 +74,7 @@ static int tcf_connmark(struct sk_buff *skb, const struct tc_action *a, ...@@ -74,7 +74,7 @@ static int tcf_connmark(struct sk_buff *skb, const struct tc_action *a,
zone.id = ca->zone; zone.id = ca->zone;
zone.dir = NF_CT_DEFAULT_ZONE_DIR; zone.dir = NF_CT_DEFAULT_ZONE_DIR;
thash = nf_conntrack_find_get(dev_net(skb->dev), &zone, &tuple); thash = nf_conntrack_find_get(ca->net, &zone, &tuple);
if (!thash) if (!thash)
goto out; goto out;
...@@ -119,6 +119,7 @@ static int tcf_connmark_init(struct net *net, struct nlattr *nla, ...@@ -119,6 +119,7 @@ static int tcf_connmark_init(struct net *net, struct nlattr *nla,
ci = to_connmark(a); ci = to_connmark(a);
ci->tcf_action = parm->action; ci->tcf_action = parm->action;
ci->net = net;
ci->zone = parm->zone; ci->zone = parm->zone;
tcf_hash_insert(a); tcf_hash_insert(a);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment