From owner-freebsd-net@FreeBSD.ORG Sat Feb 24 11:47:49 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3BD2B16A402 for ; Sat, 24 Feb 2007 11:47:49 +0000 (UTC) (envelope-from j.witteveen@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.232]) by mx1.freebsd.org (Postfix) with ESMTP id DA36C13C467 for ; Sat, 24 Feb 2007 11:47:48 +0000 (UTC) (envelope-from j.witteveen@gmail.com) Received: by nz-out-0506.google.com with SMTP id i11so786151nzh for ; Sat, 24 Feb 2007 03:47:48 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:references; b=Dw5Vb7DkZ2qYRTElIqG/X7VqDYNwJsjdOEGrwnOhEKjoCOWNKcYasIT5BT23RmRRXy3SyqGS6qACKsAV2yiG08Q+CqW+CtevBigP/R1HDhFRHLiaX3F4fU9gbJbsfy9yvA7tL9biuwKe6YlHMZTgz3iDArLcpzEO6q8y5qBqZzo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:references; b=b623m0o+w4usJ8hVSDj9vpVLCTuvurxxNGChBS+2ElsteBZKkoibkze6jMR6ag40n90arumk/3oM97ZUEqVYcWVMT7sF5nY7evnwjEBV97UsaU+K1f6nR15ZqSzntV/rqygNoqUEenkeeE1m9722ylT3lc9sE8dWepYtBSt2Q/g= Received: by 10.115.54.1 with SMTP id g1mr29668wak.1172317667952; Sat, 24 Feb 2007 03:47:47 -0800 (PST) Received: by 10.114.12.1 with HTTP; Sat, 24 Feb 2007 03:47:47 -0800 (PST) Message-ID: <3993a4980702240347o2ee0388bx42e29854928cadfd@mail.gmail.com> Date: Sat, 24 Feb 2007 12:47:47 +0100 From: "Jouke Witteveen" Cc: freebsd-net@freebsd.org In-Reply-To: <45D748C5.6040904@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_65670_21733424.1172317667877" References: <3993a4980702051233u10c30575kd1f6d27fcd600110@mail.gmail.com> <45C7A1F9.20306@FreeBSD.org> <3993a4980702170546t7f9384eaq358986a4cc734582@mail.gmail.com> <45D748C5.6040904@FreeBSD.org> Subject: Re: [PATCH] Re: ioctl: SIOCADDMULTI (howto?) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Feb 2007 11:47:49 -0000 ------=_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 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--