netdev
[Top] [All Lists]

Re: af_packet.c bug?

To: Thomas Graf <tgraf@xxxxxxx>
Subject: Re: af_packet.c bug?
From: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Date: Mon, 28 Mar 2005 12:33:41 -0800
Cc: "'netdev@xxxxxxxxxxx'" <netdev@xxxxxxxxxxx>
In-reply-to: <20050328201738.GG3086@xxxxxxxxxxxxxx>
Organization: Candela Technologies
References: <424858D4.8060604@xxxxxxxxxxxxxxx> <20050328195557.GF3086@xxxxxxxxxxxxxx> <4248642E.40304@xxxxxxxxxxxxxxx> <20050328201738.GG3086@xxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020
Thomas Graf wrote:
* Ben Greear <4248642E.40304@xxxxxxxxxxxxxxx> 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 <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com


<Prev in Thread] Current Thread [Next in Thread>