From: itojun Date: Fri, 14 Apr 2000 02:38:20 +0000 (+0000) Subject: recover "ifconfig -a" and "ifconfig -A" behavior for inet (least surprise). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e8ee070f2651360d2577def7cd9ef21597eb216c;p=openbsd recover "ifconfig -a" and "ifconfig -A" behavior for inet (least surprise). --- diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile index 395452430e2..9b7d0d9be80 100644 --- a/sbin/ifconfig/Makefile +++ b/sbin/ifconfig/Makefile @@ -1,9 +1,10 @@ -# $OpenBSD: Makefile,v 1.5 1999/12/30 16:19:31 itojun Exp $ +# $OpenBSD: Makefile,v 1.6 2000/04/14 02:38:20 itojun Exp $ PROG= ifconfig MAN= ifconfig.8 CPPFLAGS+=-DINET6 +#CPPFLAGS+=-DHAVE_IFADDRS_H # kame scopeid hack CPPFLAGS+=-DKAME_SCOPEID diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 04fdd4169b2..8626077e88c 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.32 2000/04/11 18:08:42 mickey Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.33 2000/04/14 02:38:21 itojun Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -81,7 +81,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94"; #else -static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.32 2000/04/11 18:08:42 mickey Exp $"; +static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.33 2000/04/14 02:38:21 itojun Exp $"; #endif #endif /* not lint */ @@ -620,10 +620,9 @@ printif(ifrm, ifaliases) sizeof(ifrp->ifr_name))) { register const struct afswtch *p; -#if 0 - if (ifaliases == 0 && noinet == 0) + if (ifrp->ifr_addr.sa_family == AF_INET && + ifaliases == 0 && noinet == 0) continue; -#endif ifr = *ifrp; #ifdef INET6 /* quickhack: sizeof(ifr) < sizeof(ifr6) */ @@ -640,7 +639,8 @@ printif(ifrm, ifaliases) } } count++; - noinet = 0; + if (ifrp->ifr_addr.sa_family == AF_INET) + noinet = 0; continue; } }