From 679bfaf0cd195898f6bf5c874734dc9bc1cb6119 Mon Sep 17 00:00:00 2001 From: dlg Date: Tue, 2 Mar 2021 23:40:06 +0000 Subject: [PATCH] fix an assert in veb_p_ioctl() that failed when called by a span port. veb_p_ioctl() is used by both veb bridge and veb span ports, but it had an assert to check that it was being called by a veb bridge port. this extends the check so using it on a span port doesnt cause a panic. found by dave voutila --- sys/net/if_veb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/net/if_veb.c b/sys/net/if_veb.c index 44e1e0faa18..5425b3fa694 100644 --- a/sys/net/if_veb.c +++ b/sys/net/if_veb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_veb.c,v 1.12 2021/02/26 01:57:20 dlg Exp $ */ +/* $OpenBSD: if_veb.c,v 1.13 2021/03/02 23:40:06 dlg Exp $ */ /* * Copyright (c) 2021 David Gwynne @@ -1794,8 +1794,9 @@ veb_p_ioctl(struct ifnet *ifp0, u_long cmd, caddr_t data) KASSERTMSG(eb != NULL, "%s: %s called without an ether_brport set", ifp0->if_xname, __func__); - KASSERTMSG(eb->eb_input == veb_port_input, - "%s: %s called, but eb_input seems wrong (%p != veb_port_input())", + KASSERTMSG((eb->eb_input == veb_port_input) || + (eb->eb_input == veb_span_input), + "%s called %s, but eb_input (%p) seems wrong", ifp0->if_xname, __func__, eb->eb_input); p = eb->eb_port; -- 2.20.1