diff options
author | 2016-11-03 09:17:47 +0000 | |
---|---|---|
committer | 2016-11-03 09:17:47 +0000 | |
commit | 508e3a9abde751ee2a818ed7eb8b7cf36b607a66 (patch) | |
tree | bf2dd3ac1d8802446c0cd66ee710963da59674a3 | |
parent | The networking code no longer runs off software interrupts. (diff) | |
download | wireguard-openbsd-508e3a9abde751ee2a818ed7eb8b7cf36b607a66.tar.xz wireguard-openbsd-508e3a9abde751ee2a818ed7eb8b7cf36b607a66.zip |
Always call if_put() during the interface iteration on port status multipart
reply to avoid reference leaks.
ok mikeb@
-rw-r--r-- | sys/net/switchofp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/switchofp.c b/sys/net/switchofp.c index 42fe3da9f45..841b99ec4e5 100644 --- a/sys/net/switchofp.c +++ b/sys/net/switchofp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: switchofp.c,v 1.23 2016/10/31 08:06:27 rzalamena Exp $ */ +/* $OpenBSD: switchofp.c,v 1.24 2016/11/03 09:17:47 rzalamena Exp $ */ /* * Copyright (c) 2016 Kazuya GODA <goda@openbsd.org> @@ -5699,9 +5699,10 @@ swofp_mp_recv_port_stats(struct switch_softc *sc, struct mbuf *m) postat.pt_duration_sec = htonl((uint32_t)duration.tv_sec); postat.pt_duration_nsec = htonl(duration.tv_nsec); + if_put(ifs); + if ((error = swofp_mpmsg_put(&swmp, (caddr_t)&postat, sizeof(postat)))) { - if_put(ifs); splx(s); goto failed; } |