Thread (9 messages) 9 messages, 3 authors, 2005-04-01

Re: af_packet.c bug?

From: Ben Greear <hidden>
Date: 2005-03-28 20:08:14

Thomas Graf wrote:
* Ben Greear [ref] 2005-03-28 11:19
quoted
What is the '13' doing here?  Maybe it should be IFNAMSIZ?

/*
 *	Find the device first to size check it
 */

saddr->spkt_device[13] = 0;
dev = dev_get_by_name(saddr->spkt_device);
err = -ENODEV;
if (dev == NULL)
	goto out_unlock;

Seems so, please adopt the size of spkt_device in struct sockaddr_pkt
you mean adapt maybe?
as well if you change it, it's currently hardcoded as 14.
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.

That would save the device lookup for each packet sent.

I figure that we would need to listen for NETDEV_UNREGISTER
events and do a dev_put whenever the device wants to go away.

Does that sound workable?

Ben

-- 
Ben Greear [off-list ref]
Candela Technologies Inc  http://www.candelatech.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help