From owner-svn-src-head@FreeBSD.ORG Wed May 15 22:56:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E945B639; Wed, 15 May 2013 22:56:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CAFD8FB6; Wed, 15 May 2013 22:56:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4FMuO3J042396; Wed, 15 May 2013 22:56:24 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4FMuOl1042394; Wed, 15 May 2013 22:56:24 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305152256.r4FMuOl1042394@svn.freebsd.org> From: Mark Johnston Date: Wed, 15 May 2013 22:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250685 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 15 May 2013 22:56:25 -0000 Author: markj Date: Wed May 15 22:56:24 2013 New Revision: 250685 URL: http://svnweb.freebsd.org/changeset/base/250685 Log: Convert a couple of helper scripts used to test the ip provider to work on FreeBSD. In the IPv6 case, try each interface before returning an error; each IPv6-enabled interface will have a link-local address even if the link isn't up. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl Wed May 15 21:37:08 2013 (r250684) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl Wed May 15 22:56:24 2013 (r250685) @@ -73,7 +73,7 @@ die "Could not determine local IP addres # Find the first remote host that responds to an icmp echo, # which isn't a local address. # -open PING, "/sbin/ping -ns $Broadcast{$local} 56 $MAXHOSTS |" or +open PING, "/sbin/ping -n -s 56 -c $MAXHOSTS $Broadcast{$local} |" or die "Couldn't run ping: $!\n"; while () { if (/bytes from (.*): / and not defined $Broadcast{$1}) { Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl Wed May 15 21:37:08 2013 (r250684) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl Wed May 15 22:56:24 2013 (r250685) @@ -48,7 +48,9 @@ my $MULTICAST = "FF02::1"; # IPv6 multi # my $local = ""; my $remote = ""; +my $interf = ""; my %Local; +my %Addr; my $up; open IFCONFIG, '/sbin/ifconfig -a inet6 |' or die "Couldn't run ifconfig: $!\n"; @@ -59,27 +61,34 @@ while () { $up = 1 if /^[a-z].*) { - if (/bytes from (.*): / and not defined $Local{$1}) { - $remote = $1; - last; +foreach $interf (split(' ', `ifconfig -l -u inet6`)) { + next if $interf =~ /lo[0-9]+/; + open PING, "/sbin/ping6 -n -s 56 -c $MAXHOSTS $MULTICAST\%$interf |" or next; + while () { + if (/bytes from (.*), / and not defined $Local{$1}) { + $remote = $1; + $local = $Addr{$interf}; + last; + } } } close PING;