]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: initialize with 0 before setting erspan md->u
authorXin Long <lucien.xin@gmail.com>
Sun, 13 Sep 2020 11:43:03 +0000 (19:43 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Sep 2020 23:53:38 +0000 (16:53 -0700)
commit5172d64c480930c4beaf6b2597a98b714e97bc4b
tree14d2af7c1ff1a284ba31c3062f76e1ea1b57559f
parent63e0347d9723629d61d1a413d34ca6c11a871556
net: sched: initialize with 0 before setting erspan md->u

In fl_set_erspan_opt(), all bits of erspan md was set 1, as this
function is also used to set opt MASK. However, when setting for
md->u.index for opt VALUE, the rest bits of the union md->u will
be left 1. It would cause to fail the match of the whole md when
version is 1 and only index is set.

This patch is to fix by initializing with 0 before setting erspan
md->u.

Reported-by: Shuang Li <shuali@redhat.com>
Fixes: bb6392608074 ("net: sched: allow flower to match erspan options")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_flower.c