summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2013-06-18 11:03:04 +0200
committerFlorian Westphal <fw@strlen.de>2013-06-18 16:10:00 +0200
commitaaae8eba22f8bef2155b69b171f9654815f6c697 (patch)
treee8696c40dd5730e3651326b87d7d012b47c72d06
parentf850813a7d9a43f62d7b4089283ddf3b77a80678 (diff)
conntrack: CONNLABELS are not a nested attribute
This fixes construction of the conntrack object when CTA_LABEL attribute is present. Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r--src/conntrack/parse.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/conntrack/parse.c b/src/conntrack/parse.c
index cb185d0..c003744 100644
--- a/src/conntrack/parse.c
+++ b/src/conntrack/parse.c
@@ -480,20 +480,16 @@ __parse_timestamp(const struct nfattr *attr, struct nf_conntrack *ct)
static void
__parse_labels(const struct nfattr *attr, struct nf_conntrack *ct)
{
- struct nfattr *tb[CTA_LABELS];
struct nfct_bitmask *mask;
- uint16_t len = NFA_PAYLOAD(tb[CTA_LABELS-1]);
+ uint16_t len;
- nfnl_parse_nested(tb, CTA_LABELS, attr);
- if (tb[CTA_LABELS-1]) {
+ len = NFA_PAYLOAD(attr);
+ if (len) {
mask = nfct_bitmask_new((len * CHAR_BIT) - 1);
if (!mask)
return;
-
- if (len)
- memcpy(mask->bits, NFA_DATA(tb[CTA_LABELS-1]), len);
-
- set_bit(ATTR_CONNLABELS, ct->head.set);
+ memcpy(mask->bits, NFA_DATA(attr), len);
+ nfct_set_attr(ct, ATTR_CONNLABELS, mask);
}
}