diff options
author | Sebastian Benoit <benno@cvs.openbsd.org> | 2017-05-29 09:56:34 +0000 |
---|---|---|
committer | Sebastian Benoit <benno@cvs.openbsd.org> | 2017-05-29 09:56:34 +0000 |
commit | 2b09ba69d0d91259e7ef3972916968faeb2395b2 (patch) | |
tree | 41f4bf4e6eb378a47712a9d1e05062af4274c87e /usr.sbin/bgpd | |
parent | 25f541e1ffcc40847b9857af9c9bc3a472c135df (diff) |
change bgpd's control socket from /var/run/bgpd.sock to
/var/run/bgpd.sock.<rdomain> in both bgpd and bgpctl. makes life
easier for admins.
ok phessler, claudio, henning, feedback from Job Snijders
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/bgpd.conf.5 | 11 | ||||
-rw-r--r-- | usr.sbin/bgpd/config.c | 8 |
2 files changed, 12 insertions, 7 deletions
diff --git a/usr.sbin/bgpd/bgpd.conf.5 b/usr.sbin/bgpd/bgpd.conf.5 index 45bfe634203..dfa6600070e 100644 --- a/usr.sbin/bgpd/bgpd.conf.5 +++ b/usr.sbin/bgpd/bgpd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: bgpd.conf.5,v 1.157 2017/05/28 16:52:27 jmc Exp $ +.\" $OpenBSD: bgpd.conf.5,v 1.158 2017/05/29 09:56:33 benno Exp $ .\" .\" Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> .\" Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -16,7 +16,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 28 2017 $ +.Dd $Mdocdate: May 29 2017 $ .Dt BGPD.CONF 5 .Os .Sh NAME @@ -417,8 +417,11 @@ If .Ic restricted is specified a restricted control socket will be created. By default -.Pa /var/run/bgpd.sock -is used and no restricted socket is created. +.Pa /var/run/bgpd.sock.<rdomain> +is used where +.Ar <rdomain> +is the routing domain in which bgpd has been started. +By default, no restricted socket is created. .Pp .It Xo .Ic transparent-as diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c index 8d0f34e2653..62781a8ad2e 100644 --- a/usr.sbin/bgpd/config.c +++ b/usr.sbin/bgpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.66 2017/05/28 15:16:33 henning Exp $ */ +/* $OpenBSD: config.c,v 1.67 2017/05/29 09:56:33 benno Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org> @@ -28,6 +28,7 @@ #include <ifaddrs.h> #include <netdb.h> #include <stdlib.h> +#include <stdio.h> #include <string.h> #include <unistd.h> @@ -44,7 +45,7 @@ void free_rdomains(struct rdomain_head *); struct bgpd_config * new_config(void) { - struct bgpd_config *conf; + struct bgpd_config *conf; if ((conf = calloc(1, sizeof(struct bgpd_config))) == NULL) fatal(NULL); @@ -54,7 +55,8 @@ new_config(void) conf->fib_priority = RTP_BGP; conf->default_tableid = getrtable(); - if ((conf->csock = strdup(SOCKET_NAME)) == NULL) + if (asprintf(&conf->csock, "%s.%d", SOCKET_NAME, + conf->default_tableid) == -1) fatal(NULL); if ((conf->filters = calloc(1, sizeof(struct filter_head))) == NULL) |