OSDN Git Service

net: ip6_gre: always reports o_key to userspace
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Mon, 28 Jan 2019 21:23:49 +0000 (22:23 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Jan 2019 22:00:02 +0000 (14:00 -0800)
commitc706863bc8902d0c2d1a5a27ac8e1ead5d06b79d
tree7fc6274da5e7d4d1f6ab84ea6ce86a7d72f9928d
parentfeaf5c796b3f0240f10d0d6d0b686715fd58a05b
net: ip6_gre: always reports o_key to userspace

As Erspan_v4, Erspan_v6 protocol relies on o_key to configure
session id header field. However TUNNEL_KEY bit is cleared in
ip6erspan_tunnel_xmit since ERSPAN protocol does not set the key field
of the external GRE header and so the configured o_key is not reported
to userspace. The issue can be triggered with the following reproducer:

$ip link add ip6erspan1 type ip6erspan local 2000::1 remote 2000::2 \
    key 1 seq erspan_ver 1
$ip link set ip6erspan1 up
ip -d link sh ip6erspan1

ip6erspan1@NONE: <BROADCAST,MULTICAST> mtu 1422 qdisc noop state DOWN mode DEFAULT
    link/ether ba:ff:09:24:c3:0e brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 1500
    ip6erspan remote 2000::2 local 2000::1 encaplimit 4 flowlabel 0x00000 ikey 0.0.0.1 iseq oseq

Fix the issue adding TUNNEL_KEY bit to the o_flags parameter in
ip6gre_fill_info

Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_gre.c