mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-01 08:27:59 +00:00
ifconfig if0 netmask xxx.xxx.xxx.0 didn't change the netmask.
PR: bin/28833 MFC after: 3 days
This commit is contained in:
parent
b886b9c7d4
commit
59e7e5d169
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=80392
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user