diff options
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 12 | ||||
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 3 | ||||
-rw-r--r-- | usr.sbin/bgpd/config.c | 3 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.c | 4 |
4 files changed, 14 insertions, 8 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index f6856b263f6..6286045a290 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.132 2006/01/24 14:26:52 claudio Exp $ */ +/* $OpenBSD: bgpd.c,v 1.133 2006/03/15 11:33:42 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -86,7 +86,7 @@ usage(void) extern char *__progname; fprintf(stderr, "usage: %s [-dnv] ", __progname); - fprintf(stderr, "[-D macro=value] [-f file] [-r path]\n"); + fprintf(stderr, "[-D macro=value] [-f file] [-s path] [-r path]\n"); exit(1); } @@ -130,8 +130,9 @@ main(int argc, char *argv[]) TAILQ_INIT(&net_l); TAILQ_INIT(rules_l); peer_l = NULL; + conf.csock = SOCKET_NAME; - while ((ch = getopt(argc, argv, "dD:f:nr:v")) != -1) { + while ((ch = getopt(argc, argv, "dD:f:nr:s:v")) != -1) { switch (ch) { case 'd': debug = 1; @@ -155,6 +156,9 @@ main(int argc, char *argv[]) case 'r': conf.rcsock = optarg; break; + case 's': + conf.csock = optarg; + break; default: usage(); /* NOTREACHED */ @@ -352,7 +356,7 @@ main(int argc, char *argv[]) } free(rules_l); - control_cleanup(SOCKET_NAME); + control_cleanup(conf.csock); control_cleanup(conf.rcsock); kr_shutdown(); pftable_clear_all(); diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index f0b58ab3009..9573e2d2d92 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.192 2006/02/10 14:34:40 claudio Exp $ */ +/* $OpenBSD: bgpd.h,v 1.193 2006/03/15 11:33:42 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -142,6 +142,7 @@ struct bgpd_config { struct filter_set_head staticset; struct filter_set_head staticset6; struct listen_addrs *listen_addrs; + char *csock; char *rcsock; int opts; int flags; diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c index d65a3af6c51..1464491e42b 100644 --- a/usr.sbin/bgpd/config.c +++ b/usr.sbin/bgpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.47 2006/01/24 10:03:44 henning Exp $ */ +/* $OpenBSD: config.c,v 1.48 2006/03/15 11:33:42 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org> @@ -47,6 +47,7 @@ merge_config(struct bgpd_config *xconf, struct bgpd_config *conf, /* preserve cmd line opts */ conf->opts = xconf->opts; + conf->csock = xconf->csock; conf->rcsock = xconf->rcsock; if (!conf->as) { diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 61e34b4c7cb..faf343ae23b 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.244 2006/02/08 12:36:29 henning Exp $ */ +/* $OpenBSD: session.c,v 1.245 2006/03/15 11:33:42 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org> @@ -194,7 +194,7 @@ session_main(struct bgpd_config *config, struct peer *cpeers, } /* control socket is outside chroot */ - if ((csock = control_init(0, SOCKET_NAME)) == -1) + if ((csock = control_init(0, conf->csock)) == -1) fatalx("control socket setup failed"); if (conf->rcsock != NULL && (rcsock = control_init(1, conf->rcsock)) == -1) |