Module Name: src
Committed By: ozaki-r
Date: Fri Aug 15 15:32:24 UTC 2014
Modified Files:
src/sys/net: if_bridge.c
Log Message:
bridge: reject non-IFF_SIMPLEX interfaces
bridge does not work with !IFF_SIMPLEX interfaces (PR/18035);
the bug is not yet fixed. Until it gets fixed, we should
reject non-IFF_SIMPLEX interfaces.
Discussed with pooka@
To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/net/if_bridge.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.90 src/sys/net/if_bridge.c:1.91
--- src/sys/net/if_bridge.c:1.90 Wed Jul 23 05:32:23 2014
+++ src/sys/net/if_bridge.c Fri Aug 15 15:32:24 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bridge.c,v 1.90 2014/07/23 05:32:23 ozaki-r Exp $ */
+/* $NetBSD: if_bridge.c,v 1.91 2014/08/15 15:32:24 ozaki-r Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.90 2014/07/23 05:32:23 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.91 2014/08/15 15:32:24 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_bridge_ipf.h"
@@ -800,6 +800,10 @@ bridge_ioctl_add(struct bridge_softc *sc
if (ifs->if_input != ether_input)
return EINVAL;
+ /* FIXME: doesn't work with non-IFF_SIMPLEX interfaces */
+ if ((ifs->if_flags & IFF_SIMPLEX) == 0)
+ return EINVAL;
+
bif = malloc(sizeof(*bif), M_DEVBUF, M_NOWAIT);
if (bif == NULL)
return (ENOMEM);