diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2000-11-23 12:56:52 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2000-11-23 12:56:52 +0000 |
commit | 424ac01ae7be65be6cb7844e77ae94d576bfd8c1 (patch) | |
tree | dc22aa9cc3e277790fb3993a6287572ab7f0f7e7 /sbin | |
parent | 2ae426da520b59b1849ddb7dc954a0db451374b8 (diff) |
Merge with EOM 1.56
author: niklas
style nits
author: angelos
Print and use correct port when looking at listening sockets.
Don't setup unnecessary flows on the receiver side.
author: angelos
Careful on the type used by inet_ntoa()
author: niklas
byte ordering
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/isakmpd/udp.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sbin/isakmpd/udp.c b/sbin/isakmpd/udp.c index 08c3d2c07c0..f8afb1cd79f 100644 --- a/sbin/isakmpd/udp.c +++ b/sbin/isakmpd/udp.c @@ -1,5 +1,5 @@ -/* $OpenBSD: udp.c,v 1.23 2000/10/16 23:27:23 niklas Exp $ */ -/* $EOM: udp.c,v 1.52 2000/10/15 22:02:55 niklas Exp $ */ +/* $OpenBSD: udp.c,v 1.24 2000/11/23 12:56:51 niklas Exp $ */ +/* $EOM: udp.c,v 1.56 2000/11/23 12:22:08 niklas Exp $ */ /* * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. @@ -334,8 +334,8 @@ udp_bind_if (struct ifreq *ifrp, void *arg) t = udp_bind (if_addr, port); if (!t) { - log_print ("udp_bind_if: failed to create a socket on %x:%d", - htons (if_addr), port); + log_print ("udp_bind_if: failed to create a socket on %s:%d", + inet_ntoa (*((struct in_addr *)&if_addr)), port); return; } LIST_INSERT_HEAD (&udp_listen_list, (struct udp_transport *)t, link); @@ -343,7 +343,7 @@ udp_bind_if (struct ifreq *ifrp, void *arg) /* * NAME is a section name found in the config database. Setup and return - * a transport useable to talk to the peer specified by that name + * a transport useable to talk to the peer specified by that name. */ static struct transport * udp_create (char *name) @@ -406,11 +406,12 @@ udp_create (char *name) log_print ("udp_create: inet_addr (\"%s\") failed", addr_str); return 0; } - u = udp_listen_lookup (addr, port); + u = udp_listen_lookup (addr, (udp_default_port ? htons (udp_default_port) : + htons (UDP_DEFAULT_PORT))); if (!u) { log_print ("udp_create: %s:%d must exist as a listener too", addr_str, - port); + udp_default_port); return 0; } return udp_clone (u, &dst); @@ -646,7 +647,7 @@ udp_decode_port (char *port_str) log_print ("udp_decode_port: service \"%s\" unknown", port_str); return 0; } - return service->s_port; + return ntohs (service->s_port); } else if (port_long < 1 || port_long > 65535) { |