diff options
author | ume <ume@FreeBSD.org> | 2001-07-26 16:44:19 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2001-07-26 16:44:19 +0000 |
commit | ad2a92535a38126b277ecfe0c0eceba50dfc055d (patch) | |
tree | 27157d7eabc12619eb09ca1dd9785a063a61654a /sbin/ifconfig/ifconfig.c | |
parent | a0f2f0574677e9cbc40140ac801e7ffeed12f57f (diff) | |
download | FreeBSD-src-ad2a92535a38126b277ecfe0c0eceba50dfc055d.zip FreeBSD-src-ad2a92535a38126b277ecfe0c0eceba50dfc055d.tar.gz |
ifconfig if0 netmask xxx.xxx.xxx.0 didn't change the netmask.
PR: bin/28833
MFC after: 3 days
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 36f6595..34f9d03 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); } |