diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2018-04-10 06:57:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-10 11:03:32 -0400 |
commit | 1cc5954f44150bb70cac07c3cc5df7cf0dfb61ec (patch) | |
tree | f266f669d38fd047fcd5a136a2c1052698d064bf /net | |
parent | c18bb396d3d261ebbb4efbc05129c5d354c541e4 (diff) |
ip_gre: clear feature flags when incompatible o_flags are set
Commit dd9d598c6657 ("ip_gre: add the support for i/o_flags update via
netlink") added the ability to change o_flags, but missed that the
GSO/LLTX features are disabled by default, and only enabled some gre
features are unused. Thus we also need to disable the GSO/LLTX features
on the device when the TUNNEL_SEQ or TUNNEL_CSUM flags are set.
These two examples should result in the same features being set:
ip link add gre_none type gre local 192.168.0.10 remote 192.168.0.20 ttl 255 key 0
ip link set gre_none type gre seq
ip link add gre_seq type gre local 192.168.0.10 remote 192.168.0.20 ttl 255 key 1 seq
Fixes: dd9d598c6657 ("ip_gre: add the support for i/o_flags update via netlink")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Acked-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ip_gre.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index a8772a978224..9c169bb2444d 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -781,8 +781,14 @@ static void ipgre_link_update(struct net_device *dev, bool set_mtu) | |||
781 | tunnel->encap.type == TUNNEL_ENCAP_NONE) { | 781 | tunnel->encap.type == TUNNEL_ENCAP_NONE) { |
782 | dev->features |= NETIF_F_GSO_SOFTWARE; | 782 | dev->features |= NETIF_F_GSO_SOFTWARE; |
783 | dev->hw_features |= NETIF_F_GSO_SOFTWARE; | 783 | dev->hw_features |= NETIF_F_GSO_SOFTWARE; |
784 | } else { | ||
785 | dev->features &= ~NETIF_F_GSO_SOFTWARE; | ||
786 | dev->hw_features &= ~NETIF_F_GSO_SOFTWARE; | ||
784 | } | 787 | } |
785 | dev->features |= NETIF_F_LLTX; | 788 | dev->features |= NETIF_F_LLTX; |
789 | } else { | ||
790 | dev->hw_features &= ~NETIF_F_GSO_SOFTWARE; | ||
791 | dev->features &= ~(NETIF_F_LLTX | NETIF_F_GSO_SOFTWARE); | ||
786 | } | 792 | } |
787 | } | 793 | } |
788 | 794 | ||