summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenno <benno@openbsd.org>2018-07-11 21:10:07 +0000
committerbenno <benno@openbsd.org>2018-07-11 21:10:07 +0000
commit03e73dbc418d2d2cf74596e8313a78da54739a70 (patch)
treefd68d9024699b0413aa9905b6647662c0f0667b8
parentRemove RTM_LOSING from the file, it is no longer used by OpenBSD and (diff)
downloadwireguard-openbsd-03e73dbc418d2d2cf74596e8313a78da54739a70.tar.xz
wireguard-openbsd-03e73dbc418d2d2cf74596e8313a78da54739a70.zip
The routing table bgpd runs in needs to be a routing domain.
ok claudio henning
-rw-r--r--usr.sbin/bgpd/config.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c
index 2a2e5dfa314..cdb65308a36 100644
--- a/usr.sbin/bgpd/config.c
+++ b/usr.sbin/bgpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.68 2018/02/10 01:24:28 benno Exp $ */
+/* $OpenBSD: config.c,v 1.69 2018/07/11 21:10:07 benno Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -46,6 +46,7 @@ struct bgpd_config *
new_config(void)
{
struct bgpd_config *conf;
+ u_int rdomid;
if ((conf = calloc(1, sizeof(struct bgpd_config))) == NULL)
fatal(NULL);
@@ -54,6 +55,10 @@ new_config(void)
conf->bgpid = get_bgpid();
conf->fib_priority = RTP_BGP;
conf->default_tableid = getrtable();
+ ktable_exists(conf->default_tableid, &rdomid);
+ if (rdomid != conf->default_tableid)
+ fatalx("current routing table %u is not a routing domain",
+ conf->default_tableid);
if (asprintf(&conf->csock, "%s.%d", SOCKET_NAME,
conf->default_tableid) == -1)