summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2015-04-10 12:00:26 -0700
committerDavid S. Miller <davem@davemloft.net>2015-04-12 21:25:13 -0400
commit9272f048727513c1b28e5cd7b1425dae49111d5d (patch)
tree5434608359b462d47a4f4d450ba01b10f5485af3 /net
parentd72da6aa00497ed86836a1d41fc55e2809a8ca18 (diff)
downloadlinux-9272f048727513c1b28e5cd7b1425dae49111d5d.tar.gz
linux-9272f048727513c1b28e5cd7b1425dae49111d5d.tar.bz2
linux-9272f048727513c1b28e5cd7b1425dae49111d5d.zip
fou: avoid calling udp_del_offload() twice
This fixes the following harmless warning: ./ip/ip fou del port 7777 [ 122.907516] udp_del_offload: didn't find offload for port 7777 Cc: Tom Herbert <tom@herbertland.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/fou.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
index ff069f6597ac..c8db62718e5f 100644
--- a/net/ipv4/fou.c
+++ b/net/ipv4/fou.c
@@ -410,7 +410,8 @@ static void fou_release(struct fou *fou)
struct socket *sock = fou->sock;
struct sock *sk = sock->sk;
- udp_del_offload(&fou->udp_offloads);
+ if (sk->sk_family == AF_INET)
+ udp_del_offload(&fou->udp_offloads);
list_del(&fou->list);
@@ -528,7 +529,6 @@ static int fou_destroy(struct net *net, struct fou_cfg *cfg)
spin_lock(&fou_lock);
list_for_each_entry(fou, &fou_list, list) {
if (fou->port == port) {
- udp_del_offload(&fou->udp_offloads);
fou_release(fou);
err = 0;
break;