diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2015-09-11 08:54:55 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2015-09-11 08:54:55 +0000 |
commit | 23ae394b1a762f581f82b7d2c7c461fa0e16a295 (patch) | |
tree | 8978338ff9952d3b311ae972b166577d67bc864d /sys | |
parent | efdb77a4816910797e7924515a219316f7a74f7b (diff) |
iterate over the new half of the if idx map rather than loop on the one
entry forever.
this will fix hangs when you have more than 7 interfaces.
ok mpi@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 4f7987db59e..2c144af027a 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.369 2015/09/10 18:11:05 dlg Exp $ */ +/* $OpenBSD: if.c,v 1.370 2015/09/11 08:54:54 dlg Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -275,8 +275,10 @@ if_idxmap_insert(struct ifnet *ifp) for (i = 0; i < if_map->limit; i++) nmap[i] = map[i]; - while (i < nlimit) + while (i < nlimit) { nmap[i] = NULL; + i++; + } if_idxmap.map = nif_map; free(if_map, M_IFADDR, sizeof(*nif_map) + |