netfilter: ctnetlink: send event when conntrack label was modified
authorFlorian Westphal <fw@strlen.de>
Fri, 21 Jun 2013 14:51:30 +0000 (16:51 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 24 Jun 2013 09:32:56 +0000 (11:32 +0200)
commit 0ceabd83875b72a29f33db4ab703d6ba40ea4c58
(netfilter: ctnetlink: deliver labels to userspace) sets the event bit
when we raced with another packet, instead of raising the event bit
when the label bit is set for the first time.

commit 9b21f6a90924dfe8e5e686c314ddb441fb06501e
(netfilter: ctnetlink: allow userspace to modify labels) forgot to update
the event mask in the "conntrack already exists" case.

Both issues result in CTA_LABELS attribute not getting included in the
conntrack event.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_labels.c
net/netfilter/nf_conntrack_netlink.c

index 8fe2e99428b724086184d6b201369b6aeda82cf2..355d2ef0809477a36176ff5287bd8bfc25faee8c 100644 (file)
@@ -45,7 +45,7 @@ int nf_connlabel_set(struct nf_conn *ct, u16 bit)
        if (test_bit(bit, labels->bits))
                return 0;
 
-       if (test_and_set_bit(bit, labels->bits))
+       if (!test_and_set_bit(bit, labels->bits))
                nf_conntrack_event_cache(IPCT_LABEL, ct);
 
        return 0;
index 6d0f8a17c5b77d6c02b4df99ceddb02f48954b3e..ecf065f9403213141655410c049c49646498fac5 100644 (file)
@@ -1825,6 +1825,7 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
                        nf_conntrack_eventmask_report((1 << IPCT_REPLY) |
                                                      (1 << IPCT_ASSURED) |
                                                      (1 << IPCT_HELPER) |
+                                                     (1 << IPCT_LABEL) |
                                                      (1 << IPCT_PROTOINFO) |
                                                      (1 << IPCT_NATSEQADJ) |
                                                      (1 << IPCT_MARK),