summaryrefslogtreecommitdiff
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-01-15 20:02:38 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-01-15 20:02:38 +0000
commit8d5007cbc9cebcb358c4994864adf3fb2bd14fa6 (patch)
tree939ebbc94c4340406b1c07da073bf2397eecb896 /sys/net/if_bridge.c
parent8d516a422867f6bd49b003ee6c805cf74dd9fc35 (diff)
Don't allow enc0 to be added to a bridge, as it's used for all
non-bound SAs...
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 656b462faa1..961f7c2f448 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.23 2000/01/15 05:02:46 jason Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.24 2000/01/15 20:02:36 angelos Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -33,6 +33,7 @@
#include "bridge.h"
#include "bpfilter.h"
+#include "enc.h"
#if NBRIDGE > 0
@@ -59,6 +60,9 @@
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/if_ether.h>
+#include <netinet/ip_ipsp.h>
+
+#include <net/if_enc.h>
#ifdef IPFILTER
#include <netinet/ip_fil_compat.h>
#include <netinet/ip_fil.h>
@@ -284,7 +288,14 @@ bridge_ioctl(ifp, cmd, data)
break;
}
}
- else if (ifs->if_type != IFT_ENC) {
+ else if (ifs->if_type == IFT_ENC) {
+#if NENC > 0
+ /* Can't bind enc0 to a bridge */
+ if (ifs->if_softc == &encif[0])
+ return EINVAL;
+#endif /* NENC */
+ }
+ else {
error = EINVAL;
break;
}