opensubscriber
   Find in this group all groups
 
Unknown more information…

b : bridge@lists.osdl.org 3 March 2007 • 7:34AM -0500

Re: [Bridge] [RFC 1/2] bridge: avoid ptype_all packet handling
by Stephen Hemminger

REPLY TO AUTHOR
 
REPLY TO GROUP




On Fri, 02 Mar 2007 15:18:03 -0800 (PST)
David Miller <davem@dave...> wrote:

> From: David Miller <davem@dave...>
> Date: Fri, 02 Mar 2007 14:48:18 -0800 (PST)
>
> > Back to a workable solution, why doesn't DHCP specify a specific
> > device?  It would fix this performance problem completely, at the
> > application level.
>
> Since nobody seems to be able to be bothered to actually look
> at what DHCP clients are doing, I actually did and it's no
> surprise that broken stuff is happening here.

I was in middle of checking that..

> Here is how dhcp3-3.0.3 binds AF_PACKET sockets, in common/lpf.c:
>
> struct sockaddr sa;
>  ...
> /* Bind to the interface name */
> memset (&sa, 0, sizeof sa);
> sa.sa_family = AF_PACKET;
> strncpy (sa.sa_data, (const char *)info -> ifp, sizeof sa.sa_data);
> if (bind (sock, &sa, sizeof sa)) {
> if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT ||
>     errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT ||
>     errno == EAFNOSUPPORT || errno == EINVAL) {
> log_error ("socket: %m - make sure");
> log_error ("CONFIG_PACKET (Packet socket) %s",
>    "and CONFIG_FILTER");
> log_error ("(Socket Filtering) are enabled %s",
>    "in your kernel");
> log_fatal ("configuration!");
> }
> log_fatal ("Bind socket to interface: %m");
> }
>
> So it puts a string into the sockaddr data, and there
> is no mention of sockaddr_ll, which is what is supposed to be
> provided as the socket address here, in the entire DHCP tree.
>
> I'm tempted to say I must be missing something here, since I can't see
> how this could possible work at all.  The string passed in should
> be interpreted as the ifindex value, and thus trigger a -ENODEV
> return from AF_PACKET's bind() implementation.
>
> My suspicions are confirmed by the patch here:
>
> http://kernel.org/pub/linux/kernel/people/chuyee/patches/dhcp-3.0/dhcp-3.0-linux_cooked_packet.patch

Can you get FC fixed?

> Really, this bogus bind() explains everything.

Should we add a warning to kernel log, to make distro's fix it?

It might make sense to add a per-device ptype_dev list in network device?



--
Stephen Hemminger <shemminger@linu...>
_______________________________________________
Bridge mailing list
Bridge@list...
https://lists.osdl.org/mailman/listinfo/bridge

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.