it doesnt make sense to configure a vport as a span port.
authordlg <dlg@openbsd.org>
Tue, 28 Dec 2021 23:10:58 +0000 (23:10 +0000)
committerdlg <dlg@openbsd.org>
Tue, 28 Dec 2021 23:10:58 +0000 (23:10 +0000)
sys/net/if_veb.c

index 24df521..ad7c0a3 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_veb.c,v 1.22 2021/12/28 23:10:30 dlg Exp $ */
+/*     $OpenBSD: if_veb.c,v 1.23 2021/12/28 23:10:58 dlg Exp $ */
 
 /*
  * Copyright (c) 2021 David Gwynne <dlg@openbsd.org>
@@ -1297,6 +1297,11 @@ veb_add_port(struct veb_softc *sc, const struct ifbreq *req, unsigned int span)
        if (span) {
                port_list = &sc->sc_spans;
 
+               if (isvport) {
+                       error = EPROTONOSUPPORT;
+                       goto free;
+               }
+
                p->p_brport.eb_input = veb_span_input;
                p->p_bif_flags = IFBIF_SPAN;
        } else {