lkml.org 
[lkml]   [2006]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Bug in the RTM_SETLINK kernel API for setting MAC address
Date
From
David Miller <davem@davemloft.net> wrote:

> > The real mismatch is that ida[IFLA_ADDRESS - 1] is (as you say)
> > suppose to be a MAC address, but the set_mac_address() functions
> > for each device assume that the RTA_DATA(ida[IFLA_ADDRESS - 1])
> > payload is a sockaddr.
>
> That's because ->set_mac_address() is usually invoked via
> dev_set_mac_address() which in turn is invoked from places
> SIOCSIFHWADDR ioctl() processing which does want the sockaddr
> wrapped around the MAC address.
>
> So the netlink code is definitely doing the wrong thing if
> it wants merely the MAC address in the attribute.
>
> Since changing all the drivers is a pain, what we probably
> should do is have the netlink code allocate a sockaddr,
> place the MAC address attribute in to that allocated sockaddr,
> and pass it into ->set_mac_address().
>
> This patch should do the trick, can you test it out?

Yes, it works.

Can I presume that the fix will be in the next kernel release
(2.6.17.8 or 2.6.18), so we will know to reverse our userland
work-around changes when the kernel is out.

Thanks,
Pavlin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-08 20:29    [W:0.030 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site