netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net] loopback: explicitly set pkt_type to PACKET_HOST
@ 2014-05-14 18:39 Cong Wang
  2014-05-14 21:24 ` Cong Wang
  2014-05-15 20:34 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Cong Wang @ 2014-05-14 18:39 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Eric W. Biederman, Cong Wang, Cong Wang

From: Cong Wang <cwang@twopensource.com>

In a corner case where I redirect the packets from veth to lo,
packets are dropped silently when entering IP stack. This is
due to we have a different MAC addr on veth, so the packets are
marked as PACKET_OTHERHOST. And after they are redirect to lo,
this value is kept since lo has the same MAC addr with the packets.
Loopback should explicitly set it to PACKET_HOST before calling
eth_type_trans() for this specific case.

Cc: David S. Miller <davem@davemloft.net>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>

---
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index bb96409..52b6625 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -81,6 +81,7 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,
 	 */
 	skb_dst_force(skb);
 
+	skb->pkt_type = PACKET_HOST;
 	skb->protocol = eth_type_trans(skb, dev);
 
 	/* it's OK to use per_cpu_ptr() because BHs are off */

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-16 20:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-14 18:39 [Patch net] loopback: explicitly set pkt_type to PACKET_HOST Cong Wang
2014-05-14 21:24 ` Cong Wang
2014-05-15 20:34 ` David Miller
2014-05-16 17:52   ` Cong Wang
2014-05-16 19:17     ` David Miller
2014-05-16 20:57       ` Cong Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).