summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/bgpd.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-03-15 11:33:43 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-03-15 11:33:43 +0000
commit64430f2f95c9d18a1cc59542c459f2d16a687e11 (patch)
treea1e87fdb5084a14a289b1c6bbf0f363a16915281 /usr.sbin/bgpd/bgpd.c
parentad29d0e6d58273c0ac473ccf4e7d7986993d74fb (diff)
Allow the control socket to be changed on the command line. Useful if you
need to run multiple bgpds on a single box to simulate a IX. This helped me massivly debugging error reports. OK henning@
Diffstat (limited to 'usr.sbin/bgpd/bgpd.c')
-rw-r--r--usr.sbin/bgpd/bgpd.c12
1 files changed, 8 insertions, 4 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();