Subject: Re: [PATCH] net: packet: option to only pass skb protocol

From: "Michael S. Tsirkin" <[email-masked]>
Date: Tue, 5 Jan 2010 23:45:24 +0200

On Tue, Jan 05, 2010 at 01:42:18PM -0800, David Miller wrote:
> From: "Chris Friesen" <[email-masked]>
> Date: Tue, 05 Jan 2010 15:28:22 -0600
> 
> > On 01/05/2010 12:57 PM, Michael S. Tsirkin wrote:
> >> When sending packets with a packet socket it is often necessary to set
> >> protocol in msg_name: otherwise the protocol field in the skb will not
> >> be set correctly.
> > 
> > What about automatically detecting the protocol from the data being sent
> > to avoid the necessity of specifying it in the first place?
> 
> This limits packet socket usage to only protocols the kernel is aware
> of, defeating part of the usefulness of the packet socket facility.

We could do this if the protocol is ETH_P_ALL -  skbs end up with this
protocol currently when sendmsg does not have msgname and when socket is
set up to listen for all packets.  It's not a valid protocol value, is
it?

-- 
MST