mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 10:29:15 +00:00
Don't set ifaddr::in_addrs to 1 after an ``iface clear'' on an interface
with no addresses.
This commit is contained in:
parent
35099b5d17
commit
278657c32d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55531
@ -251,12 +251,14 @@ iface_inClear(struct iface *iface, int how)
|
||||
{
|
||||
int n, addrs;
|
||||
|
||||
addrs = n = how == IFACE_CLEAR_ALL ? 0 : 1;
|
||||
for (; n < iface->in_addrs; n++)
|
||||
iface_addr_Zap(iface->name, iface->in_addr + n);
|
||||
if (iface->in_addrs) {
|
||||
addrs = n = how == IFACE_CLEAR_ALL ? 0 : 1;
|
||||
for (; n < iface->in_addrs; n++)
|
||||
iface_addr_Zap(iface->name, iface->in_addr + n);
|
||||
|
||||
iface->in_addrs = addrs;
|
||||
/* Don't bother realloc()ing - we have little to gain */
|
||||
iface->in_addrs = addrs;
|
||||
/* Don't bother realloc()ing - we have little to gain */
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user