summaryrefslogtreecommitdiff
path: root/sbin/isakmpd
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-03-02 15:12:01 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-03-02 15:12:01 +0000
commit1da65d431757ae9f6932e9e5d8a29841a0f421f7 (patch)
tree500323f4d2cb40a9cc536bbc7e10a8a663a60c1b /sbin/isakmpd
parent7b2cd771b944628b6a83900bc78d38d0b0e86152 (diff)
if.c: Merge with EOM 1.8
Deal with old socket APIs udp.c: Merge with EOM 1.31 Deal with old socket APIs message.c: Merge with EOM 1.107 Remove unnecessary system dependent include
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r--sbin/isakmpd/if.c8
-rw-r--r--sbin/isakmpd/message.c5
-rw-r--r--sbin/isakmpd/udp.c17
3 files changed, 23 insertions, 7 deletions
diff --git a/sbin/isakmpd/if.c b/sbin/isakmpd/if.c
index 5c337a20cad..6fbe8f99e97 100644
--- a/sbin/isakmpd/if.c
+++ b/sbin/isakmpd/if.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: if.c,v 1.4 1999/02/26 03:37:08 niklas Exp $ */
-/* $EOM: if.c,v 1.7 1999/02/25 11:39:00 niklas Exp $ */
+/* $OpenBSD: if.c,v 1.5 1999/03/02 15:12:00 niklas Exp $ */
+/* $EOM: if.c,v 1.8 1999/03/02 14:26:12 niklas Exp $ */
/*
* Copyright (c) 1998 Niklas Hallqvist. All rights reserved.
@@ -117,8 +117,12 @@ if_map (void (*func) (struct ifreq *, void *), void *arg)
{
ifrp = (struct ifreq *)p;
(*func) (ifrp, arg);
+#ifdef USE_OLD_SOCKADDR
+ len = sizeof ifrp->ifr_name + sizeof ifrp->ifr_addr;
+#else
len = sizeof ifrp->ifr_name
+ MAX (ifrp->ifr_addr.sa_len, sizeof ifrp->ifr_addr);
+#endif
}
return 0;
}
diff --git a/sbin/isakmpd/message.c b/sbin/isakmpd/message.c
index 595172a7572..60ff640e8a8 100644
--- a/sbin/isakmpd/message.c
+++ b/sbin/isakmpd/message.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: message.c,v 1.9 1999/02/26 03:47:46 niklas Exp $ */
-/* $EOM: message.c,v 1.106 1999/02/25 11:39:15 niklas Exp $ */
+/* $OpenBSD: message.c,v 1.10 1999/03/02 15:12:00 niklas Exp $ */
+/* $EOM: message.c,v 1.107 1999/03/02 14:23:04 niklas Exp $ */
/*
* Copyright (c) 1998 Niklas Hallqvist. All rights reserved.
@@ -38,7 +38,6 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <machine/endian.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sbin/isakmpd/udp.c b/sbin/isakmpd/udp.c
index c21596b71a4..084da1fd713 100644
--- a/sbin/isakmpd/udp.c
+++ b/sbin/isakmpd/udp.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: udp.c,v 1.7 1999/02/26 03:51:33 niklas Exp $ */
-/* $EOM: udp.c,v 1.30 1999/02/25 11:39:25 niklas Exp $ */
+/* $OpenBSD: udp.c,v 1.8 1999/03/02 15:12:00 niklas Exp $ */
+/* $EOM: udp.c,v 1.31 1999/03/02 14:26:13 niklas Exp $ */
/*
* Copyright (c) 1998 Niklas Hallqvist. All rights reserved.
@@ -61,6 +61,11 @@
#define BACKLOG 16
#define UDP_SIZE 65536
+/* If a system doesn't have SO_REUSEPORT, SO_REUSEADDR will have to do. */
+#ifndef SO_REUSEPORT
+#define SO_REUSEPORT SO_REUSEADDR
+#endif
+
/* XXX IPv4 specific. */
struct udp_transport {
struct transport transport;
@@ -198,7 +203,9 @@ udp_bind (in_addr_t addr, in_port_t port)
struct sockaddr_in src;
memset (&src, 0, sizeof src);
+#ifndef USE_OLD_SOCKADDR
src.sin_len = sizeof src;
+#endif
src.sin_family = AF_INET;
src.sin_addr.s_addr = addr;
src.sin_port = port;
@@ -222,8 +229,12 @@ udp_bind_if (struct ifreq *ifrp, void *arg)
* Well UDP is an internet protocol after all so drop other ifreqs.
* XXX IPv6 support is missing.
*/
+#ifdef USE_OLD_SOCKADDR
+ if (ifrp->ifr_addr.sa_family != AF_INET)
+#else
if (ifrp->ifr_addr.sa_family != AF_INET
|| ifrp->ifr_addr.sa_len != sizeof (struct sockaddr_in))
+#endif
return;
/*
@@ -295,7 +306,9 @@ udp_create (char *name)
}
memset (&dst, 0, sizeof dst);
+#ifndef USE_OLD_SOCKADDR
dst.sin_len = sizeof dst;
+#endif
dst.sin_family = AF_INET;
dst.sin_addr.s_addr = addr;
dst.sin_port = htons (port);