Commit 97b5f8c9 authored by Xin Long's avatar Xin Long Committed by Greg Kroah-Hartman

ip6_gre: fix a dst leak in ip6erspan_tunnel_xmit

[ Upstream commit 28e48603 ]

In ip6erspan_tunnel_xmit(), if the skb will not be sent out, it has to
be freed on the tx_err path. Otherwise when deleting a netns, it would
cause dst/dev to leak, and dmesg shows:

  unregister_netdevice: waiting for lo to become free. Usage count = 1

Fixes: ef7baf5e ("ip6_gre: add ip6 erspan collect_md mode")
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Acked-by: default avatarWilliam Tu <u9012063@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4fb95f29
...@@ -988,7 +988,7 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb, ...@@ -988,7 +988,7 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
if (unlikely(!tun_info || if (unlikely(!tun_info ||
!(tun_info->mode & IP_TUNNEL_INFO_TX) || !(tun_info->mode & IP_TUNNEL_INFO_TX) ||
ip_tunnel_info_af(tun_info) != AF_INET6)) ip_tunnel_info_af(tun_info) != AF_INET6))
return -EINVAL; goto tx_err;
key = &tun_info->key; key = &tun_info->key;
memset(&fl6, 0, sizeof(fl6)); memset(&fl6, 0, sizeof(fl6));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment