summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/udp.c
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-08-13 14:33:36 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-08-13 14:33:36 +0000
commit23bfc638e92a88043673b111d2863490162c2e47 (patch)
tree1f41573c20d3e9ca39b47cc5d17ead023b93212f /sbin/isakmpd/udp.c
parent7558101cf54e3ecde54fbd01f31fa636c4fbf2ab (diff)
use getifaddrs(3) rather than SIOCGIFCONF. in fact, if_map() does not do
the right thing on certain set of interface addresses. SIOCGIFCONF is the worst possible ioctl API...
Diffstat (limited to 'sbin/isakmpd/udp.c')
-rw-r--r--sbin/isakmpd/udp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/isakmpd/udp.c b/sbin/isakmpd/udp.c
index d88083bcb64..960e9254692 100644
--- a/sbin/isakmpd/udp.c
+++ b/sbin/isakmpd/udp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp.c,v 1.47 2001/08/12 15:48:44 angelos Exp $ */
+/* $OpenBSD: udp.c,v 1.48 2001/08/13 14:33:35 itojun Exp $ */
/* $EOM: udp.c,v 1.57 2001/01/26 10:09:57 niklas Exp $ */
/*
@@ -266,7 +266,7 @@ udp_clone (struct udp_transport *u, struct sockaddr *raddr)
* system-wide pools of known ISAKMP transports.
*/
static struct transport *
-udp_bind (struct sockaddr *addr)
+udp_bind (const struct sockaddr *addr)
{
struct sockaddr *src = malloc (addr->sa_len);
@@ -282,10 +282,10 @@ udp_bind (struct sockaddr *addr)
* create an UDP server socket bound to it.
*/
static void
-udp_bind_if (struct ifreq *ifrp, void *arg)
+udp_bind_if (char *ifname, struct sockaddr *if_addr, void *arg)
{
char *port = (char *)arg;
- struct sockaddr *if_addr = &ifrp->ifr_addr, saddr;
+ struct sockaddr saddr;
struct conf_list *listen_on;
struct udp_transport *u;
struct conf_list_node *address;
@@ -352,7 +352,7 @@ udp_bind_if (struct ifreq *ifrp, void *arg)
if_addr->sa_family);
return;
}
- strncpy (flags_ifr.ifr_name, ifrp->ifr_name, sizeof flags_ifr.ifr_name - 1);
+ strncpy (flags_ifr.ifr_name, ifname, sizeof flags_ifr.ifr_name - 1);
if (ioctl (s, SIOCGIFFLAGS, (caddr_t)&flags_ifr) == -1)
{
log_error ("udp_bind_if: ioctl (%d, SIOCGIFFLAGS, ...) failed", s);