diff options
author | Cedric Berger <cedric@cvs.openbsd.org> | 2003-09-26 11:29:12 +0000 |
---|---|---|
committer | Cedric Berger <cedric@cvs.openbsd.org> | 2003-09-26 11:29:12 +0000 |
commit | 25c59bb9af1086454d7e3ae7653b868500e2a271 (patch) | |
tree | 3e00bfa522e2c163843c850c84aa4f515ae9e6e5 /sbin/isakmpd/udp.c | |
parent | de1117a64309ba0718a0017ac01de9820b510121 (diff) |
don't listen to INADDR_ANY if Listen-on is specified.
patch from markus@, ok ho@
Diffstat (limited to 'sbin/isakmpd/udp.c')
-rw-r--r-- | sbin/isakmpd/udp.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sbin/isakmpd/udp.c b/sbin/isakmpd/udp.c index 47176b311ea..8abdaf4c03b 100644 --- a/sbin/isakmpd/udp.c +++ b/sbin/isakmpd/udp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp.c,v 1.64 2003/06/10 16:41:29 deraadt Exp $ */ +/* $OpenBSD: udp.c,v 1.65 2003/09/26 11:29:11 cedric Exp $ */ /* $EOM: udp.c,v 1.57 2001/01/26 10:09:57 niklas Exp $ */ /* @@ -637,6 +637,7 @@ udp_init (void) { struct sockaddr_storage dflt_stor; struct sockaddr_in *dflt = (struct sockaddr_in *)&dflt_stor; + struct conf_list *listen_on; char *port; long lport; char *ep; @@ -653,6 +654,16 @@ udp_init (void) log_fatal ("udp_init: Could not bind the ISAKMP UDP port %s on all " "interfaces", port); + /* Only listen to the specified address if Listen-on is configured */ + listen_on = conf_get_list ("General", "Listen-on"); + if (listen_on) + { + LOG_DBG ((LOG_TRANSPORT, 50, + "udp_init: not binding ISAKMP UDP port to INADDR_ANY")); + conf_free_list (listen_on); + return; + } + /* * Get port. * XXX Use getservbyname too. |