From: benno Date: Wed, 11 Jul 2018 21:10:07 +0000 (+0000) Subject: The routing table bgpd runs in needs to be a routing domain. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=03e73dbc418d2d2cf74596e8313a78da54739a70;p=openbsd The routing table bgpd runs in needs to be a routing domain. ok claudio henning --- 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 @@ -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)