]> git.baikalelectronics.ru Git - kernel.git/commit
ip_gre: get key from session_id correctly in erspan_rcv
authorXin Long <lucien.xin@gmail.com>
Sun, 1 Oct 2017 14:00:53 +0000 (22:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Oct 2017 05:30:32 +0000 (22:30 -0700)
commit1b63099afb1e9f65797563d8cb5e8883570ef5c9
tree48aad16a52961261ec52b28feaaa2b2412ef2b0e
parent4e92256b00efe9c9acc2ba90fa4e1892da8217b7
ip_gre: get key from session_id correctly in erspan_rcv

erspan only uses the first 10 bits of session_id as the key to look
up the tunnel. But in erspan_rcv, it missed 'session_id & ID_MASK'
when getting the key from session_id.

If any other flag is also set in session_id in a packet, it would
fail to find the tunnel due to incorrect key in erspan_rcv.

This patch is to add 'session_id & ID_MASK' there and also remove
the unnecessary variable session_id.

Fixes: 468dae257e70 ("gre: introduce native tunnel support for ERSPAN")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_gre.c