Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Dec 2010 13:19:27 +0000
From:      Gavin Atkinson <gavin@FreeBSD.org>
To:        Weongyo Jeong <weongyo@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r216089 - head/sbin/ifconfig
Message-ID:  <1291295967.58583.59.camel@buffy.york.ac.uk>
In-Reply-To: <201012010324.oB13OdL8060240@svn.freebsd.org>
References:  <201012010324.oB13OdL8060240@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 2010-12-01 at 03:24 +0000, Weongyo Jeong wrote:
> Author: weongyo
> Date: Wed Dec  1 03:24:38 2010
> New Revision: 216089
> URL: http://svn.freebsd.org/changeset/base/216089
>=20
> Log:
>   Don't print usbus[0-9] interfaces that it's not the interesting
>   interface type for ifconfig(8).
>=20
> Modified:
>   head/sbin/ifconfig/ifconfig.c
>=20
> Modified: head/sbin/ifconfig/ifconfig.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sbin/ifconfig/ifconfig.c	Tue Nov 30 22:39:46 2010	(r216088)
> +++ head/sbin/ifconfig/ifconfig.c	Wed Dec  1 03:24:38 2010	(r216089)
> @@ -295,6 +295,8 @@ main(int argc, char *argv[])
>  			sdl =3D (const struct sockaddr_dl *) ifa->ifa_addr;
>  		else
>  			sdl =3D NULL;
> +		if (sdl !=3D NULL && sdl->sdl_type =3D=3D IFT_USB)
> +			continue;
>  		if (cp !=3D NULL && strcmp(cp, ifa->ifa_name) =3D=3D 0 && !namesonly)
>  			continue;
>  		iflen =3D strlcpy(name, ifa->ifa_name, sizeof(name));

I may be misunderstanding, but isn't this more of a hack than the
correct solution?  I appreciate that there are a large number of defined
interface types, but I wonder if we should instead check for interface
types we are prepared to accept, rather than skipping ones we know we
don't want?

Was this issue introduced with the introduction of the USB pcap changes?

Thanks,

Gavin

--=20
Gavin Atkinson
FreeBSD committer and bugmeister
GPG: A093262B (313A A79F 697D 3A5C 216A  EDF5 935D EF44 A093 262B)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1291295967.58583.59.camel>