Skip to content

Commit 97aae0d

Browse files
Liping Zhangummakynes
authored andcommitted
netfilter: ctnetlink: using bit to represent the ct event
Otherwise, creating a new conntrack via nfnetlink: # conntrack -I -p udp -s 1.1.1.1 -d 2.2.2.2 -t 10 --sport 10 --dport 20 will emit the wrong ct events(where UPDATE should be NEW): # conntrack -E [UPDATE] udp 17 10 src=1.1.1.1 dst=2.2.2.2 sport=10 dport=20 [UNREPLIED] src=2.2.2.2 dst=1.1.1.1 sport=20 dport=10 mark=0 Signed-off-by: Liping Zhang <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 2638fd0 commit 97aae0d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/netfilter/nf_conntrack_netlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,9 +1929,9 @@ static int ctnetlink_new_conntrack(struct net *net, struct sock *ctnl,
19291929

19301930
err = 0;
19311931
if (test_bit(IPS_EXPECTED_BIT, &ct->status))
1932-
events = IPCT_RELATED;
1932+
events = 1 << IPCT_RELATED;
19331933
else
1934-
events = IPCT_NEW;
1934+
events = 1 << IPCT_NEW;
19351935

19361936
if (cda[CTA_LABELS] &&
19371937
ctnetlink_attach_labels(ct, cda) == 0)

0 commit comments

Comments
 (0)