Subject: Re: af_packet.c bug?

From: Ben Greear <[email-masked]>
Date: Mon, 28 Mar 2005 12:33:41 -0800

Thomas Graf wrote:
> * Ben Greear <[email-masked]> 2005-03-28 12:08
> 
>>>Seems so, please adopt the size of spkt_device in struct sockaddr_pkt
>>
>>you mean adapt maybe?
> 
> 
> Of course, stupid typo. ;->
> 
>>I was also wondering why we couldn't hold a reference to the net-device
>>instead of just it's ifindex when dealing with a bound raw socket.
> 
> 
> Saving a netdevice handle in the packet socket is not a problem but
> doing the same for the packet socket address seems to be non trivial.

Yes.  But assuming you bind the socket, you use the device saved in the packet
socket.  If you are sending to a particular device for each send(), then you'll
just have to pay the lookup costs.  I haven't looked recently, but didn't someone
finally hash the device lookup so that it's not a linear walk of the device
list now?

Ben

-- 
Ben Greear <[email-masked]>
Candela Technologies Inc  http://www.candelatech.com