]> git.baikalelectronics.ru Git - kernel.git/commit
net sched: fix encoding to use real length
authorJamal Hadi Salim <jhs@mojatatu.com>
Mon, 22 Aug 2016 11:10:20 +0000 (07:10 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Aug 2016 04:01:57 +0000 (21:01 -0700)
commit258a20d3e7d43a9dc76ccf1911ed849a8262e8ba
tree09be4d52e49ba2ce076fa45ef59b75d19b302390
parentf1ddd46c001c023de0cbfa49f0159907f7bf6ace
net sched: fix encoding to use real length

Encoding of the metadata was using the padded length as opposed to
the real length of the data which is a bug per specification.
This has not been an issue todate because all metadatum specified
so far has been 32 bit where aligned and data length are the same width.
This also includes a bug fix for validating the length of a u16 field.
But since there is no metadata of size u16 yes we are fine to include it
here.

While at it get rid of magic numbers.

Fixes: c8e4759039b0 ("net sched: introduce IFE action")
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_ife.c