Commit 02a78cdf authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by David S. Miller

[NETFILTER] ctnetlink: add marking support from userspace

This patch adds support for conntrack marking from user space.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarHarald Welte <laforge@netfilter.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 51df784e
...@@ -979,6 +979,11 @@ ctnetlink_change_conntrack(struct ip_conntrack *ct, struct nfattr *cda[]) ...@@ -979,6 +979,11 @@ ctnetlink_change_conntrack(struct ip_conntrack *ct, struct nfattr *cda[])
return err; return err;
} }
#if defined(CONFIG_IP_NF_CONNTRACK_MARK)
if (cda[CTA_MARK-1])
ct->mark = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_MARK-1]));
#endif
DEBUGP("all done\n"); DEBUGP("all done\n");
return 0; return 0;
} }
...@@ -1022,6 +1027,11 @@ ctnetlink_create_conntrack(struct nfattr *cda[], ...@@ -1022,6 +1027,11 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
if (ct->helper) if (ct->helper)
ip_conntrack_helper_put(ct->helper); ip_conntrack_helper_put(ct->helper);
#if defined(CONFIG_IP_NF_CONNTRACK_MARK)
if (cda[CTA_MARK-1])
ct->mark = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_MARK-1]));
#endif
DEBUGP("conntrack with id %u inserted\n", ct->id); DEBUGP("conntrack with id %u inserted\n", ct->id);
return 0; return 0;
......
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