Don't set ifaddr::in_addrs to 1 after an ``iface clear'' on an interface

with no addresses.
This commit is contained in:
Brian Somers 2000-01-07 03:47:12 +00:00
parent 35099b5d17
commit 278657c32d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55531

View File

@ -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