diff options
author | kn <kn@cvs.openbsd.org> | 2020-07-28 07:37:06 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2020-07-28 07:37:06 +0000 |
commit | f075c243384913ef02efbc760eb0fbd82e6961b1 (patch) | |
tree | e645d990e76a5853ff1d46b2e3128740ff4a15a3 /sys | |
parent | 12bba60f6664114601696944f2597de95aec1e87 (diff) |
Return total size if SIOCBRDGIFS passes in ifbic_len set to zero
In accordance to bridge(4) which behaves correctly as per the manual.
OK dlg
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_switch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/if_switch.c b/sys/net/if_switch.c index 53075d94d50..71279908cf5 100644 --- a/sys/net/if_switch.c +++ b/sys/net/if_switch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_switch.c,v 1.34 2020/07/22 20:37:35 mvs Exp $ */ +/* $OpenBSD: if_switch.c,v 1.35 2020/07/28 07:37:05 kn Exp $ */ /* * Copyright (c) 2016 Kazuya GODA <goda@openbsd.org> @@ -564,8 +564,10 @@ switch_port_list(struct switch_softc *sc, struct ifbifconf *bifc) TAILQ_FOREACH(swpo, &sc->sc_swpo_list, swpo_list_next) total++; - if (bifc->ifbic_len == 0) + if (bifc->ifbic_len == 0) { + n = total; goto done; + } TAILQ_FOREACH(swpo, &sc->sc_swpo_list, swpo_list_next) { memset(&breq, 0, sizeof(breq)); |