ifconfig options?

Krassimir Slavchev krassi at bulinfo.net
Wed Jan 2 08:20:29 PST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

This patch fixes the problem!

# ifconfig -l
bce0 bce1 lo0
# ifconfig -l ether
bce0 bce1

Thanks

pluknet wrote:
> Hi,
> 
> On 24/12/2007, Krassimir Slavchev <krassi at bulinfo.net> wrote:
>> 'ifconfig -l [address_family]' does not work correct on RELENG_7
>>
>>
>> FreeBSD 6.3-BETA2:
>> # ifconfig -l
>> em0 em1 plip0 lo0 pflog0
>>
>> #ifconfig -l ether
>> em0 em1
>>
>> But:
>> FreeBSD 7.0-BETA4:
>> # ifconfig -l
>> em0 em1 plip0 lo0 pflog0
>>
>> #ifconfig -l ether
>> em0 em1 plip0 lo0 pflog0
>>
>> I need this functionality to get all ethernet interfaces. Is there other
>> way to do this?
>>
> 
> To revert this functionality try this patch please.
> 
> --- /usr/src/sbin/ifconfig/ifconfig.c   2007-12-26 23:25:17.000000000 +0300
> +++ /tmp/ifconfig.c     2007-12-26 23:18:53.000000000 +0300
> @@ -298,9 +298,12 @@
>                  * Are we just listing the interfaces?
>                  */
>                 if (namesonly) {
> -                       if (ifindex > 1)
> -                               printf(" ");
> -                       fputs(name, stdout);
> +                       if (afp == NULL || afp->af_af != AF_LINK ||
> +                           sdl->sdl_type == IFT_ETHER) {
> +                               if (ifindex > 1)
> +                                       printf(" ");
> +                               fputs(name, stdout);
> +                       }
>                         continue;
>                 }
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQFHe7nGxJBWvpalMpkRAn7MAKCsjDSf+uDsMQaH1Wxh09TsP43k5wCcDksO
XPkb7nNG2p0wo6XvlvZlb+E=
=p0rg
-----END PGP SIGNATURE-----


More information about the freebsd-stable mailing list