From aaae8eba22f8bef2155b69b171f9654815f6c697 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 18 Jun 2013 11:03:04 +0200 Subject: 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 --- src/conntrack/parse.c | 14 +++++--------- 1 file 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); } } -- cgit v1.2.3