gre: fix TUNNEL_SEQ bit check on sequence numbering
authorColin Ian King <colin.king@canonical.com>
Wed, 21 Mar 2018 19:34:58 +0000 (19:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Mar 2018 18:52:43 +0000 (14:52 -0400)
commit1574639411b3ce311b846cae7fda56bf1af7d027
tree2817a1b1cd4ad4f2bdafb9c7bf2c10875a0d483f
parentfaf4db008163607e993279b7f7aa456cb4c11e9a
gre: fix TUNNEL_SEQ bit check on sequence numbering

The current logic of flags | TUNNEL_SEQ is always non-zero and hence
sequence numbers are always incremented no matter the setting of the
TUNNEL_SEQ bit.  Fix this by using & instead of |.

Detected by CoverityScan, CID#1466039 ("Operands don't affect result")

Fixes: 77a5196a804e ("gre: add sequence number for collect md mode.")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_gre.c
net/ipv6/ip6_gre.c