[PATCH] Re: ioctl: SIOCADDMULTI (howto?)

Jouke Witteveen j.witteveen at gmail.com
Sat Feb 24 11:47:49 UTC 2007


On 2/17/07, Bruce M. Simpson <bms at freebsd.org> wrote:
> 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
>
>
Thanks for that enormous stimulation; it really gave me some
confidence. I have (before I saw your ethermcast.diff patch) been
trying some things too and found that the patch attached did the job
for me. As for now I haven't found any glitches yet as a result of
this change. I notice however that you have probably foreseen quite
some situations with your patch, since it looks far more complex than
mine. However I'm pleased to see I managed to get something done
myself.

As for the netstat patch: it works like a shine! Very nicely done (ie: thanks).

I will now try to make the wired driver of wpa_supplicant work in
FreeBSD (it still isn't able to send/receive packages properly), as
that is what started this whole bug-hunt of mine.

Thanks again for your help and motivation.

Regards,
- Jouke
-------------- next part --------------
A non-text attachment was scrubbed...
Name: if.c.diff
Type: text/x-patch
Size: 578 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20070224/2327afa0/if.c.bin


More information about the freebsd-net mailing list