History

netfilter: ctnetlink: reject new conntrack request with different l4proto

Currently, user can add a conntrack with different l4proto via nfnetlink. For example, original tuple is TCP while reply tuple is SCTP. This is invalid combination, we should report EINVAL to userspace.

Liping Zhang committed 10 years ago

Commit aa0c2c61 parent 00a31011 file · +2 −0Browse files

Unified · Split

net/netfilter/nf_conntrack_netlink.c+2−0
@@ -1894,6 +1894,8 @@ static int ctnetlink_new_conntrack(struct net *net, struct sock *ctnl, · 1893 unmodified lines
18941894
18951895 if (!cda[CTA_TUPLE_ORIG] || !cda[CTA_TUPLE_REPLY])
18961896 return -EINVAL;
1897+ if (otuple.dst.protonum != rtuple.dst.protonum)
1898+ return -EINVAL;
18971899
18981900 ct = ctnetlink_create_conntrack(net, &zone, cda, &otuple,
18991901 &rtuple, u3);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t