[PATCH] Re: ioctl: SIOCADDMULTI (howto?)
Bruce M. Simpson
bms at FreeBSD.org
Sat Feb 17 18:26:16 UTC 2007
Jouke Witteveen wrote:
>
> So my apologies for suggesting it doesn't work at all; it seems that
> the application I'm trying to get to work (wpa_supplicant for wired
> interfaces) just doesn't _send_ its packets the right way.
That's a big relief! I added an item to the Wiki for someone to write a
regression test.
>
> Things aren't perfect though. In if.c the if_findmulti function is
> broken (always returns NULL). I presume just comparing the
> *LLADDR((sockaddr *)sa) data on both sockets is a better check, though
> my knowledge on these things is limited.
I think I see a possible problem, though the code looks as though it is
behaving as expected.
I am looking at RELENG_6 if.c. I think sa_equal() may be to blame.
sa_equal() performs a binary comparison on all of sa_data up to sa_len.
Looking at struct sockaddr_dl, this might not be the right thing at all
in that situation... though I need another pair of eyes to look. Can
anyone shed light on this? An AF_INET and AF_INET6 address can be
completely specified and compared with sa_equal(). An AF_LINK address
looks as though sa_equal() may return irrational results.
>
> As for netstat, I do not really know what is keeping it from showing
> the Multicast addresses. Again: my knowledge on this matter is
> limited. All I can think of is that getifmaddrs is forgetting
> something (perhaps the lack of a group membership). Maybe you can take
> a look at it (I believe you wrote it).
I wrote the libc getifmaddrs() function and integrated it into netstat
-g; Harti Brandt wrote the NET_RT_IFMALIST support. getifmaddrs()
*should* return sockaddr_dl as well as sockaddr_in and all the others.
netstat skips over AF_LINK addresses. Try this patch to reveal them. It
doesn't seem to show the IPv4 link layer memberships underneath, which
is interesting...
>
> As I am still learning how best to contribute to a project as big as
> FreeBSD and I do not think I am skilled enough yet in C I refrain from
> writing a patch. I am eager to see one though, be it only out of
> curiosity to know what would be considered a proper fix.
Give it a try anyway! I like to think we have strong healthy egos round
here.
Regards,
BMS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llmcast.diff
Type: text/x-patch
Size: 828 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20070217/d7bf368c/llmcast.bin
More information about the freebsd-net
mailing list