Restore unintentially lost backwards compat behavior of defaulting to

family inet if not specified.  (eg: "ifconfig ed0" down would fail because
no family was specified, even though the up/down status is not per family)

Pointed out by: Wolfgang Helbig <helbig@MX.BA-Stuttgart.De>
This commit is contained in:
Peter Wemm 1997-05-07 04:28:26 +00:00
parent 48ea0bec18
commit 9c3b235f46
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25522

View File

@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
*/
static const char rcsid[] =
"$Id: ifconfig.c,v 1.26 1997/05/04 06:14:47 peter Exp $";
"$Id: ifconfig.c,v 1.27 1997/05/04 06:27:45 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -381,8 +381,7 @@ main(argc, argv)
break;
}
if (afp->af_name == NULL)
usage();
/* leave with afp non-zero */
afp = NULL; /* not a family, NULL */
}
mib[0] = CTL_NET;
@ -472,10 +471,9 @@ ifconfig(argc, argv, rafp)
int s;
strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name);
if (rafp)
ifr.ifr_addr.sa_family = rafp->af_af;
else
ifr.ifr_addr.sa_family = afs[0].af_af;
if (rafp == NULL)
rafp = &afs[0];
ifr.ifr_addr.sa_family = rafp->af_af;
if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0) {
perror("ifconfig: socket");
@ -493,7 +491,7 @@ ifconfig(argc, argv, rafp)
mtu = ifr.ifr_mtu;
if (argc == 0) {
status();
status(); /* uses global afp */
#ifdef USE_IF_MEDIA
media_status(s);
#endif