* wrt. core/dev: set pkt_type after eth_type_trans() in dev_forward_skb()
@ 2013-09-10 2:14 Maciej Żenczykowski
2013-11-11 5:15 ` Maciej Żenczykowski
0 siblings, 1 reply; 2+ messages in thread
From: Maciej Żenczykowski @ 2013-09-10 2:14 UTC (permalink / raw
To: Linux NetDev, Eric Dumazet, David Miller, Isaku Yamahata, decot
Merged in v3.11-rc1:
commit 06a23fe31ca3992863721f21bdb0307af93da807
Author: Isaku Yamahata <yamahata@valinux.co.jp>
Date: Tue Jul 2 20:30:10 2013 +0900
core/dev: set pkt_type after eth_type_trans() in dev_forward_skb()
The dev_forward_skb() assignment of pkt_type should be done
after the call to eth_type_trans().
ip-encapsulated packets can be handled by localhost. But skb->pkt_type
can be PACKET_OTHERHOST when packet comes via veth into ip tunnel device.
In that case, the packet is dropped by ip_rcv().
Although this example uses gretap. l2tp-eth also has same issue.
For l2tp-eth case, add dummy device for ip address and ip l2tp command.
...
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1659,6 +1659,12 @@ int dev_forward_skb(struct net_device *dev,
struct sk_buff *skb)
}
skb_scrub_packet(skb);
skb->protocol = eth_type_trans(skb, dev);
+
+ /* eth_type_trans() can set pkt_type.
+ * clear pkt_type _after_ calling eth_type_trans()
+ */
+ skb->pkt_type = PACKET_HOST;
+
return netif_rx(skb);
}
EXPORT_SYMBOL_GPL(dev_forward_skb);
Appears to me to be bogus.
AFAICT, this results in (at least) veth devices effectively ignoring
destination mac addresses,
since eth_type_trans is what sets PACKET_BROADCAST/MULTICAST/HOST/OTHERHOST,
and this makes everything functionally equivalanet to having a dst mac
address equal to the devices mac address.
(might also affect macvlan and L2TP)
- Maciej
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: wrt. core/dev: set pkt_type after eth_type_trans() in dev_forward_skb()
2013-09-10 2:14 wrt. core/dev: set pkt_type after eth_type_trans() in dev_forward_skb() Maciej Żenczykowski
@ 2013-11-11 5:15 ` Maciej Żenczykowski
0 siblings, 0 replies; 2+ messages in thread
From: Maciej Żenczykowski @ 2013-11-11 5:15 UTC (permalink / raw
To: Linux NetDev, Eric Dumazet, David Miller, Isaku Yamahata,
David Decotigny, Alexei Starovoitov
Here's the previous email on this subject.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-11 5:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-10 2:14 wrt. core/dev: set pkt_type after eth_type_trans() in dev_forward_skb() Maciej Żenczykowski
2013-11-11 5:15 ` Maciej Żenczykowski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.