Re: [PATCH net-next-2.6] packet: Add GSO/checksum offload support to af_packet sockets
From: Sridhar Samudrala <hidden>
Date: 2010-01-29 21:25:20
From: Sridhar Samudrala <hidden>
Date: 2010-01-29 21:25:20
On Fri, 2010-01-29 at 21:53 +1300, Herbert Xu wrote:
On Tue, Jan 26, 2010 at 12:30:19PM -0800, Sridhar Samudrala wrote:quoted
+ if (po->vnet_hdr) { + err = -EINVAL; + if (dev->type != ARPHRD_ETHER) + goto out_unlock;We shouldn't have Ethernet-specific code in AF_PACKET. What's more, just because the device type is Ethernet it doesn't mean that the packet is going to have an Ethernet header.
This check is to dis-allow processing of packets with virtio_net_hdr destined for non-ethernet devices. Is it OK if i add a check in packet_bind() to not allow binding to a non-ethernet device when PACKET_VNET_HDR option is set? I need to figure out a way to set the skb protocol correctly based on the packet. Any clues? Michael has posted a prototype patch that addresses this. Do you agree with this approach? http://lkml.org/lkml/2010/1/6/56 Did you get a chance to look at my other patch that adds a check for VLAN packets in skb_gso_segment() to address a bug when sending large VLAN packets from a guest? http://thread.gmane.org/gmane.linux.network/150198 Thanks Sridhar