From: bluhm Date: Sun, 7 Aug 2022 00:57:43 +0000 (+0000) Subject: Fix fallout from netlock removal in media ioctl. The bridge does X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=03364a5777399b0f362872f9fc219711ef3582a9;p=openbsd Fix fallout from netlock removal in media ioctl. The bridge does not support media parameter, so just skip these ioctls. Do not release a netlock that was not taken. panic found and fix tested by Michael Graves; OK mvs@ --- diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 2228c241b44..708f3d56abb 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.363 2022/01/04 06:32:39 yasuoka Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.364 2022/08/07 00:57:43 bluhm Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -262,8 +262,13 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* * bridge(4) data structure aren't protected by the NET_LOCK(). * Idealy it shouldn't be taken before calling `ifp->if_ioctl' - * but we aren't there yet. + * but we aren't there yet. Media ioctl run without netlock. */ + switch (cmd) { + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + return (ENOTTY); + } NET_UNLOCK(); switch (cmd) {