diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-02-23 11:20:36 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-02-23 11:20:36 +0000 |
commit | 7540d33e7a06e95fc1c12998181ea1b973836e32 (patch) | |
tree | 2b928da9b7b9fee3b4bb9f293f3cc521a085b986 /usr.sbin/bgpd/config.c | |
parent | 042eaff7411d3225c03151edeb8bed97140400e7 (diff) |
Make it possible to bind and connect to non-default ports. This is mainly
for testing. Using alternate ports does not work for session using ipsec.
OK tb@ deraadt@
Diffstat (limited to 'usr.sbin/bgpd/config.c')
-rw-r--r-- | usr.sbin/bgpd/config.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c index 234965f83fe..b11ecacf987 100644 --- a/usr.sbin/bgpd/config.c +++ b/usr.sbin/bgpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.100 2022/02/06 09:51:19 claudio Exp $ */ +/* $OpenBSD: config.c,v 1.101 2022/02/23 11:20:35 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org> @@ -447,30 +447,6 @@ prepare_listeners(struct bgpd_config *conf) int opt = 1; int r = 0; - if (TAILQ_EMPTY(conf->listen_addrs)) { - if ((la = calloc(1, sizeof(struct listen_addr))) == NULL) - fatal("setup_listeners calloc"); - la->fd = -1; - la->flags = DEFAULT_LISTENER; - la->reconf = RECONF_REINIT; - la->sa_len = sizeof(struct sockaddr_in); - ((struct sockaddr_in *)&la->sa)->sin_family = AF_INET; - ((struct sockaddr_in *)&la->sa)->sin_addr.s_addr = - htonl(INADDR_ANY); - ((struct sockaddr_in *)&la->sa)->sin_port = htons(BGP_PORT); - TAILQ_INSERT_TAIL(conf->listen_addrs, la, entry); - - if ((la = calloc(1, sizeof(struct listen_addr))) == NULL) - fatal("setup_listeners calloc"); - la->fd = -1; - la->flags = DEFAULT_LISTENER; - la->reconf = RECONF_REINIT; - la->sa_len = sizeof(struct sockaddr_in6); - ((struct sockaddr_in6 *)&la->sa)->sin6_family = AF_INET6; - ((struct sockaddr_in6 *)&la->sa)->sin6_port = htons(BGP_PORT); - TAILQ_INSERT_TAIL(conf->listen_addrs, la, entry); - } - for (la = TAILQ_FIRST(conf->listen_addrs); la != NULL; la = next) { next = TAILQ_NEXT(la, entry); if (la->reconf != RECONF_REINIT) |