diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-01-15 20:02:38 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-01-15 20:02:38 +0000 |
commit | 8d5007cbc9cebcb358c4994864adf3fb2bd14fa6 (patch) | |
tree | 939ebbc94c4340406b1c07da073bf2397eecb896 /sys/net | |
parent | 8d516a422867f6bd49b003ee6c805cf74dd9fc35 (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')
-rw-r--r-- | sys/net/if_bridge.c | 15 | ||||
-rw-r--r-- | sys/net/if_enc.h | 1 |
2 files changed, 14 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; } diff --git a/sys/net/if_enc.h b/sys/net/if_enc.h index 4abb45b62ee..c5e1a0b8024 100644 --- a/sys/net/if_enc.h +++ b/sys/net/if_enc.h @@ -57,4 +57,5 @@ struct enchdr { u_int32_t flags; }; +extern struct enc_softc encif[]; #endif |