From owner-svn-src-head@FreeBSD.ORG Wed Feb 16 14:01:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD4AC106566B; Wed, 16 Feb 2011 14:01:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id AE2E18FC08; Wed, 16 Feb 2011 14:01:21 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5F2D446B2A; Wed, 16 Feb 2011 09:01:21 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7893F8A01D; Wed, 16 Feb 2011 09:01:20 -0500 (EST) From: John Baldwin To: Bruce Simpson Date: Wed, 16 Feb 2011 08:58:53 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <200904290950.n3T9o46f075350@svn.freebsd.org> <201102151034.46242.jhb@freebsd.org> <4D5BBF76.40409@incunabulum.net> In-Reply-To: <4D5BBF76.40409@incunabulum.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201102160858.53577.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 16 Feb 2011 09:01:20 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.5 required=4.2 tests=BAYES_00,MAY_BE_FORGED, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce M Simpson Subject: Re: svn commit: r191651 - head/usr.sbin/mtest X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2011 14:01:22 -0000 On Wednesday, February 16, 2011 7:13:42 am Bruce Simpson wrote: > John, > > That's news to me. I'm pretty sure I tested this code with and without > INET6 when I checked it in, given I was mostly testing without INET6. > > This was a very long time ago, so I was surprised to receive your > message. Could something have changed to have broken mtest? I think the code was always busted (and I just tried to use mtest on 8 for the first time today with a kernel that had INET6 compiled out): int main(int argc, char **argv) { char line[LINE_LENGTH]; char *p; int i, s, s6; s = -1; s6 = -1; #ifdef INET s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (s == -1) err(1, "can't open IPv4 socket"); #endif #ifdef INET6 s6 = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); if (s6 == -1) err(1, "can't open IPv6 socket"); #endif With INET6 enabled in userland but a kernel not built with INET6, then the call to socket() for s6 will fail causing it to exit right away. Presumably the code should be changed to do something more like: #ifdef INET s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); #else s = -1; #endif #ifdef INET6 s6 = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); #else s6 = -1; #endif if (s < 0 && s6 < 0) err(1, "can't open socket"); However, the rest of the code in mtest needs to be updated as well to not assume that 's' and 's6' are always valid so it would be a fair amount of work. > thanks > BMS > > John Baldwin wrote: > > On Wednesday, April 29, 2009 5:50:04 am Bruce M Simpson wrote: > >> Author: bms > >> Date: Wed Apr 29 09:50:04 2009 > >> New Revision: 191651 > >> URL: http://svn.freebsd.org/changeset/base/191651 > >> > >> Log: > >> Merge IPv6-capable mtest(8) from MLDv2 branch. > >> > >> Modified: > >> head/usr.sbin/mtest/Makefile > >> head/usr.sbin/mtest/mtest.8 > >> head/usr.sbin/mtest/mtest.c > > > > This is completely broken as it fails to work if you don't have INET6 compiled > > into the kernel, even if all you want to do is test joining IPv4 multicast > > groups. > > > -- John Baldwin