]> git.ipfire.org Git - thirdparty/iproute2.git/commit
tc: flower: make use of flower_port_attr_type() safe and silent
authorSimon Horman <simon.horman@netronome.com>
Sat, 3 Dec 2016 08:52:40 +0000 (09:52 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 5 Dec 2016 18:13:26 +0000 (10:13 -0800)
commit6bd5b80cdcfbeb30b79c3ff07ce844f9e4f2c600
tree7128e991213c1e6edebf91b2a452879a03a504cc
parent61dff9ac10cb55c4f66b7df7a003c420f6f1d430
tc: flower: make use of flower_port_attr_type() safe and silent

Make use of flower_port_attr_type() safe:
* flower_port_attr_type() may return a valid index into tb[] or -1.
  Only access tb[] in the case of the former.
* Do not access null entries in tb[]

Also make usage silent - it is valid for ip_proto to be invalid,
for example if it is not specified as part of the filter.

Fixes: a1fb0d484237 ("tc: flower: Support matching on SCTP ports")
Signed-off-by: Simon Horman <simon.horman@netronome.com>
tc/f_flower.c