net: ip6_gre: initialize erspan_ver just for erspan tunnels
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Fri, 15 Feb 2019 14:10:32 +0000 (15:10 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 Feb 2019 04:14:25 +0000 (20:14 -0800)
commit4974d5f678abb34401558559d47e2ea3d1c15cba
treefc86fe3707eaedbd1dfb5337605d5dab03c63b12
parenta31687e85a36c8f72b49f3d0714922c8583d0a0b
net: ip6_gre: initialize erspan_ver just for erspan tunnels

After commit c706863bc890 ("net: ip6_gre: always reports o_key to
userspace"), ip6gre and ip6gretap tunnels started reporting TUNNEL_KEY
output flag even if it is not configured.
ip6gre_fill_info checks erspan_ver value to add TUNNEL_KEY for
erspan tunnels, however in commit 84581bdae9587 ("erspan: set
erspan_ver to 1 by default when adding an erspan dev")
erspan_ver is initialized to 1 even for ip6gre or ip6gretap
Fix the issue moving erspan_ver initialization in a dedicated routine

Fixes: c706863bc890 ("net: ip6_gre: always reports o_key to userspace")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_gre.c