* [PATCH net-next-2.6] net: Handle vlan packets in skb_gso_segment()
@ 2010-01-25 21:16 Sridhar Samudrala
2010-02-02 15:45 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Sridhar Samudrala @ 2010-01-25 21:16 UTC (permalink / raw)
To: David Miller, Herbert Xu; +Cc: netdev
Handle VLAN packets in skb_gso_segment(). Currently, when large
VLAN packets are sent via virtio_net on guest and tun on host,
skb_gso_segment() fails with EPROTONOSUPPORT.
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
diff --git a/net/core/dev.c b/net/core/dev.c
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1672,6 +1672,12 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
skb_reset_mac_header(skb);
skb->mac_len = skb->network_header - skb->mac_header;
+ if (ntohs(type) == ETH_P_8021Q) {
+ skb->protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
+ type = skb->protocol;
+ skb->mac_len += VLAN_HLEN;
+ skb_set_network_header(skb, skb->mac_len);
+ }
__skb_pull(skb, skb->mac_len);
if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net-next-2.6] net: Handle vlan packets in skb_gso_segment()
2010-01-25 21:16 [PATCH net-next-2.6] net: Handle vlan packets in skb_gso_segment() Sridhar Samudrala
@ 2010-02-02 15:45 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-02-02 15:45 UTC (permalink / raw)
To: sri; +Cc: herbert, netdev
From: Sridhar Samudrala <sri@us.ibm.com>
Date: Mon, 25 Jan 2010 13:16:34 -0800
> Handle VLAN packets in skb_gso_segment(). Currently, when large
> VLAN packets are sent via virtio_net on guest and tun on host,
> skb_gso_segment() fails with EPROTONOSUPPORT.
>
> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
...
> @@ -1672,6 +1672,12 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
>
> skb_reset_mac_header(skb);
> skb->mac_len = skb->network_header - skb->mac_header;
> + if (ntohs(type) == ETH_P_8021Q) {
> + skb->protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
> + type = skb->protocol;
> + skb->mac_len += VLAN_HLEN;
> + skb_set_network_header(skb, skb->mac_len);
> + }
> __skb_pull(skb, skb->mac_len);
>
You can't do this.
Now, VLAN packets that are GSO handled will show up differently to
sniffers than those which do not get GSO handling.
You really can't pop the MAC header and modify the skb->protocol
here.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-02 15:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-25 21:16 [PATCH net-next-2.6] net: Handle vlan packets in skb_gso_segment() Sridhar Samudrala
2010-02-02 15:45 ` David Miller
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).