Date: Sat, 24 Feb 2007 12:47:47 +0100 From: "Jouke Witteveen" <j.witteveen@gmail.com> Cc: freebsd-net@freebsd.org Subject: Re: [PATCH] Re: ioctl: SIOCADDMULTI (howto?) Message-ID: <3993a4980702240347o2ee0388bx42e29854928cadfd@mail.gmail.com> In-Reply-To: <45D748C5.6040904@FreeBSD.org> References: <3993a4980702051233u10c30575kd1f6d27fcd600110@mail.gmail.com> <45C7A1F9.20306@FreeBSD.org> <3993a4980702170546t7f9384eaq358986a4cc734582@mail.gmail.com> <45D748C5.6040904@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_65670_21733424.1172317667877 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 2/17/07, Bruce M. Simpson <bms@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 ------=_Part_65670_21733424.1172317667877 Content-Type: text/x-patch; name="if.c.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="if.c.diff" X-Attachment-Id: f_eyk00ycb LS0tIGlmLmMub3JpZwlXZWQgRmViIDE1IDA0OjM3OjE1IDIwMDYKKysrIGlmLmMJVGh1IEZlYiAy MiAwOToxMjoxMSAyMDA3CkBAIC0xODM4LDExICsxODM4LDE3IEBACiBpZl9maW5kbXVsdGkoc3Ry dWN0IGlmbmV0ICppZnAsIHN0cnVjdCBzb2NrYWRkciAqc2EpCiB7CiAJc3RydWN0IGlmbXVsdGlh ZGRyICppZm1hOworCWNhZGRyX3QgZGF0YSA9IExMQUREUigoc3RydWN0IHNvY2thZGRyX2RsICop c2EpOwogCiAJSUZfQUREUl9MT0NLX0FTU0VSVChpZnApOwogCiAJVEFJTFFfRk9SRUFDSChpZm1h LCAmaWZwLT5pZl9tdWx0aWFkZHJzLCBpZm1hX2xpbmspIHsKLQkJaWYgKHNhX2VxdWFsKGlmbWEt PmlmbWFfYWRkciwgc2EpKQorCQkvKgorCQkgKiBJbiBtdWx0aWNhc3Rpbmcgd2UgYXJlIG9ubHkg aW50ZXJlc3RlZCBpbiB0aGUgYWRkcmVzcyB2YWx1ZQorCQkgKiBvYnRhaW5lZCB3aXRoIExMQURE UigpLgorCQkgKi8KKwkJaWYgKGJjbXAoTExBRERSKChzdHJ1Y3Qgc29ja2FkZHJfZGwgKilpZm1h LT5pZm1hX2FkZHIpLCBkYXRhLAorCQkgICAgRVRIRVJfQUREUl9MRU4pID09IDApCiAJCQlicmVh azsKIAl9CiAK ------=_Part_65670_21733424.1172317667877--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3993a4980702240347o2ee0388bx42e29854928cadfd>