diff options
author | brian <brian@FreeBSD.org> | 2000-01-07 03:47:12 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-01-07 03:47:12 +0000 |
commit | 43392f74a4328274c4d37b24b1d4481288e9dab7 (patch) | |
tree | d999ccc1e90f8239e5b7822632f94f9d31ff0fb3 /usr.sbin/ppp | |
parent | cca6aa22640fc4bc0dd997b03f9ab818899ae36e (diff) | |
download | FreeBSD-src-43392f74a4328274c4d37b24b1d4481288e9dab7.zip FreeBSD-src-43392f74a4328274c4d37b24b1d4481288e9dab7.tar.gz |
Don't set ifaddr::in_addrs to 1 after an ``iface clear'' on an interface
with no addresses.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/iface.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/ppp/iface.c b/usr.sbin/ppp/iface.c index ebe6803..6d771ef 100644 --- a/usr.sbin/ppp/iface.c +++ b/usr.sbin/ppp/iface.c @@ -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 |