]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: cls_u32: disallow linking to root hnode
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 8 Oct 2018 10:22:34 +0000 (06:22 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Oct 2018 17:33:34 +0000 (10:33 -0700)
commit168207a88c522f1ee33c0c660068661f23f7cba1
treeda8a30c41f7825aa2defb535390bd33911ad5de7
parent88c047451d48ebfdf2d71a79ef2013ef9595e64d
net: sched: cls_u32: disallow linking to root hnode

Operation makes no sense.  Nothing will actually break if we do so
(depth limit in u32_classify() will prevent infinite loops), but
according to maintainers it's best prohibited outright.

NOTE: doing so guarantees that u32_destroy() will trigger the call
of u32_destroy_hnode(); we might want to make that unconditional.

Test:
tc qdisc add dev eth0 ingress
tc filter add dev eth0 parent ffff: protocol ip prio 100 u32 \
link 800: offset at 0 mask 0f00 shift 6 plus 0 eat match ip protocol 6 ff
should fail with
Error: cls_u32: Not linking to root node

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_u32.c