[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADvbK_dK_fBB3bQSWKkAk6adtgrHm553Hr3JGHsw67qeS0cQOw@mail.gmail.com>
Date: Wed, 2 Apr 2014 13:31:59 +0800
From: lucien xin <lucien.xin@...il.com>
To: David Miller <davem@...emloft.net>
Cc: network dev <netdev@...r.kernel.org>
Subject: Re: [PATCH] vxlan: using AF_PACKET socket to send multicast packet
cause WARNING
On Wed, Apr 2, 2014 at 4:10 AM, David Miller <davem@...emloft.net> wrote:
> This is not the correct fix.
>
> If vxlan is going to reinject dev_hard_start_xmit() bound packets into
> the ipv4 stack, it must make sure that they are well formed.
>
> The SKB traversing the ipv4 stack must either be bound to an ipv4/ipv6
> socket or be orphaned.
yeah, it's right. then I want to bound skb to vxlan's sock in
vxlan_xmit_skb(), like this:
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 1236812..8fd7e93 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1755,6 +1755,8 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
if (err)
return err;
+ skb_set_owner_w(skb, vs->sock->sk);
+
return iptunnel_xmit(rt, skb, src, dst, IPPROTO_UDP, tos, ttl, df,
false);
}
which can not only solve the issue, but also make the logic more correct.
David, how do you think?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists