summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospf6d
diff options
context:
space:
mode:
authorremi <remi@openbsd.org>2020-01-21 20:38:52 +0000
committerremi <remi@openbsd.org>2020-01-21 20:38:52 +0000
commit09e8f7802c96471b3cc391ddfb8e5f094d267a59 (patch)
tree042120626e8f14fe2768263f8a691a36f58844c4 /usr.sbin/ospf6d
parentSome remaining items for the curious. (diff)
downloadwireguard-openbsd-09e8f7802c96471b3cc391ddfb8e5f094d267a59.tar.xz
wireguard-openbsd-09e8f7802c96471b3cc391ddfb8e5f094d267a59.zip
Allow the interface setting "type p2p" to be configured globallz or per
area. Most of the other interface settings allow this. ok denis@
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r--usr.sbin/ospf6d/ospf6d.h3
-rw-r--r--usr.sbin/ospf6d/parse.y13
-rw-r--r--usr.sbin/ospf6d/printconf.c4
3 files changed, 11 insertions, 9 deletions
diff --git a/usr.sbin/ospf6d/ospf6d.h b/usr.sbin/ospf6d/ospf6d.h
index 573cc0a6503..a9e4de02a99 100644
--- a/usr.sbin/ospf6d/ospf6d.h
+++ b/usr.sbin/ospf6d/ospf6d.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospf6d.h,v 1.44 2020/01/03 17:45:02 denis Exp $ */
+/* $OpenBSD: ospf6d.h,v 1.45 2020/01/21 20:38:52 remi Exp $ */
/*
* Copyright (c) 2004, 2007 Esben Norby <norby@openbsd.org>
@@ -329,7 +329,6 @@ 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 bfb26d5f17b..f163e24149d 100644
--- a/usr.sbin/ospf6d/parse.y
+++ b/usr.sbin/ospf6d/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.48 2019/12/26 10:24:18 remi Exp $ */
+/* $OpenBSD: parse.y,v 1.49 2020/01/21 20:38:52 remi Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -102,6 +102,7 @@ struct config_defaults {
u_int16_t rxmt_interval;
u_int16_t metric;
u_int8_t priority;
+ u_int8_t p2p;
};
struct config_defaults globaldefs;
@@ -449,6 +450,9 @@ defaults : METRIC NUMBER {
}
defs->rxmt_interval = $2;
}
+ | TYPE P2P {
+ defs->p2p = 1;
+ }
;
optnl : '\n' optnl
@@ -550,6 +554,8 @@ interface : INTERFACE STRING {
iface->metric = defs->metric;
iface->priority = defs->priority;
iface->cflags |= F_IFACE_CONFIGURED;
+ if (defs->p2p == 1)
+ iface->type = IF_TYPE_POINTOPOINT;
iface = NULL;
/* interface is always part of an area */
defs = &areadefs;
@@ -566,10 +572,6 @@ 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)) >=
@@ -1034,6 +1036,7 @@ parse_config(char *filename, int opts)
defs->rxmt_interval = DEFAULT_RXMT_INTERVAL;
defs->metric = DEFAULT_METRIC;
defs->priority = DEFAULT_PRIORITY;
+ defs->p2p = 0;
conf->spf_delay = DEFAULT_SPF_DELAY;
conf->spf_hold_time = DEFAULT_SPF_HOLDTIME;
diff --git a/usr.sbin/ospf6d/printconf.c b/usr.sbin/ospf6d/printconf.c
index fec50a56865..24105c9380f 100644
--- a/usr.sbin/ospf6d/printconf.c
+++ b/usr.sbin/ospf6d/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.9 2019/12/26 10:24:18 remi Exp $ */
+/* $OpenBSD: printconf.c,v 1.10 2020/01/21 20:38:52 remi Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -135,7 +135,7 @@ 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)
+ if (iface->type == IF_TYPE_POINTOPOINT)
printf("\t\ttype p2p\n");
printf("\t}\n");