summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorremi <remi@openbsd.org>2019-12-26 10:24:18 +0000
committerremi <remi@openbsd.org>2019-12-26 10:24:18 +0000
commitb0cdd6d0db091b3eff98102ee46ca69fbc887f58 (patch)
tree408dba12d49bf36d728d7973f2577a3cd5866cc0
parentIt is believed that an implementation of madvise was available in (diff)
downloadwireguard-openbsd-b0cdd6d0db091b3eff98102ee46ca69fbc887f58.tar.xz
wireguard-openbsd-b0cdd6d0db091b3eff98102ee46ca69fbc887f58.zip
Add point-to-point support for broadcast interfaces.
tested by Kapetanakis Giannis ok denis@
-rw-r--r--usr.sbin/ospf6d/ospf6d.conf.57
-rw-r--r--usr.sbin/ospf6d/ospf6d.h3
-rw-r--r--usr.sbin/ospf6d/parse.y9
-rw-r--r--usr.sbin/ospf6d/printconf.c5
4 files changed, 18 insertions, 6 deletions
diff --git a/usr.sbin/ospf6d/ospf6d.conf.5 b/usr.sbin/ospf6d/ospf6d.conf.5
index 0a70d025c35..720bfbaa1fa 100644
--- a/usr.sbin/ospf6d/ospf6d.conf.5
+++ b/usr.sbin/ospf6d/ospf6d.conf.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ospf6d.conf.5,v 1.19 2019/05/26 09:27:09 remi Exp $
+.\" $OpenBSD: ospf6d.conf.5,v 1.20 2019/12/26 10:24:18 remi Exp $
.\"
.\" Copyright (c) 2005 Esben Norby <norby@openbsd.org>
.\" Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -17,7 +17,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: May 26 2019 $
+.Dd $Mdocdate: December 26 2019 $
.Dt OSPF6D.CONF 5
.Os
.Sh NAME
@@ -328,6 +328,9 @@ Router.
.It Ic transmit-delay Ar seconds
Set the transmit delay.
The default value is 1; valid range is 1\-3600 seconds.
+.It Ic type p2p
+Set the interface type to point to point.
+This disables the election of a DR and BDR for the given interface.
.El
.Sh FILES
.Bl -tag -width "/etc/ospf6d.conf" -compact
diff --git a/usr.sbin/ospf6d/ospf6d.h b/usr.sbin/ospf6d/ospf6d.h
index f9263fa2f5c..3b115da52ad 100644
--- a/usr.sbin/ospf6d/ospf6d.h
+++ b/usr.sbin/ospf6d/ospf6d.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospf6d.h,v 1.42 2019/12/23 07:33:49 denis Exp $ */
+/* $OpenBSD: ospf6d.h,v 1.43 2019/12/26 10:24:18 remi Exp $ */
/*
* Copyright (c) 2004, 2007 Esben Norby <norby@openbsd.org>
@@ -329,6 +329,7 @@ struct iface {
u_int8_t if_type;
u_int8_t linkstate;
u_int8_t priority;
+ u_int8_t p2p;
u_int8_t cflags;
#define F_IFACE_PASSIVE 0x01
#define F_IFACE_CONFIGURED 0x02
diff --git a/usr.sbin/ospf6d/parse.y b/usr.sbin/ospf6d/parse.y
index 2ac7d9b64f6..bfb26d5f17b 100644
--- a/usr.sbin/ospf6d/parse.y
+++ b/usr.sbin/ospf6d/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.47 2019/12/23 07:33:49 denis Exp $ */
+/* $OpenBSD: parse.y,v 1.48 2019/12/26 10:24:18 remi Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -126,7 +126,7 @@ typedef struct {
%token AREA INTERFACE ROUTERID FIBPRIORITY FIBUPDATE REDISTRIBUTE RTLABEL
%token RDOMAIN STUB ROUTER SPFDELAY SPFHOLDTIME EXTTAG
-%token METRIC PASSIVE
+%token METRIC P2P PASSIVE
%token HELLOINTERVAL TRANSMITDELAY
%token RETRANSMITINTERVAL ROUTERDEADTIME ROUTERPRIORITY
%token SET TYPE
@@ -566,6 +566,10 @@ interfaceopts_l : interfaceopts_l interfaceoptsl nl
;
interfaceoptsl : PASSIVE { iface->cflags |= F_IFACE_PASSIVE; }
+ | TYPE P2P {
+ iface->p2p = 1;
+ iface->type = IF_TYPE_POINTOPOINT;
+ }
| DEMOTE STRING {
if (strlcpy(iface->demote_group, $2,
sizeof(iface->demote_group)) >=
@@ -645,6 +649,7 @@ lookup(char *s)
{"metric", METRIC},
{"no", NO},
{"on", ON},
+ {"p2p", P2P},
{"passive", PASSIVE},
{"rdomain", RDOMAIN},
{"redistribute", REDISTRIBUTE},
diff --git a/usr.sbin/ospf6d/printconf.c b/usr.sbin/ospf6d/printconf.c
index 5b7951bd1f9..fec50a56865 100644
--- a/usr.sbin/ospf6d/printconf.c
+++ b/usr.sbin/ospf6d/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.8 2018/12/29 16:04:31 remi Exp $ */
+/* $OpenBSD: printconf.c,v 1.9 2019/12/26 10:24:18 remi Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -135,6 +135,9 @@ print_iface(struct iface *iface)
printf("\t\trouter-priority %d\n", iface->priority);
printf("\t\ttransmit-delay %d\n", iface->transmit_delay);
+ if (iface->p2p)
+ printf("\t\ttype p2p\n");
+
printf("\t}\n");
}