From ad2a92535a38126b277ecfe0c0eceba50dfc055d Mon Sep 17 00:00:00 2001 From: ume Date: Thu, 26 Jul 2001 16:44:19 +0000 Subject: [PATCH] ifconfig if0 netmask xxx.xxx.xxx.0 didn't change the netmask. PR: bin/28833 MFC after: 3 days --- sbin/ifconfig/ifconfig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 36f6595716bb..34f9d038c8bb 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -127,6 +127,7 @@ int metric; int mtu; int setaddr; int setipdst; +int setmask; int doalias; int clearaddr; int newaddr = 1; @@ -742,7 +743,7 @@ ifconfig(argc, argv, afp) newaddr = 0; } } - if (newaddr && setaddr) { + if (newaddr && (setaddr || setmask)) { strncpy(afp->af_addreq, name, sizeof ifr.ifr_name); if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) Perror("ioctl (SIOCAIFADDR)"); @@ -861,6 +862,7 @@ setifnetmask(addr, dummy, s, afp) { if (*afp->af_getaddr == NULL) return; + setmask++; (*afp->af_getaddr)(addr, MASK); }