summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/sysdep/linux/sysdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/isakmpd/sysdep/linux/sysdep.c')
-rw-r--r--sbin/isakmpd/sysdep/linux/sysdep.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sbin/isakmpd/sysdep/linux/sysdep.c b/sbin/isakmpd/sysdep/linux/sysdep.c
index 6098a43ed40..c9f8a17f6c8 100644
--- a/sbin/isakmpd/sysdep/linux/sysdep.c
+++ b/sbin/isakmpd/sysdep/linux/sysdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysdep.c,v 1.9 2001/08/12 12:03:02 heko Exp $ */
+/* $OpenBSD: sysdep.c,v 1.10 2001/10/26 12:23:45 ho Exp $ */
/*
* Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved.
@@ -94,6 +94,21 @@ sysdep_progname ()
return __progname;
}
+/* Return the length of the sockaddr struct. */
+u_int8_t
+sysdep_sa_len (struct sockaddr *sa)
+{
+ switch (sa->sa_family)
+ {
+ case AF_INET:
+ return sizeof (struct sockaddr_in);
+ case AF_INET6:
+ return sizeof (struct sockaddr_in6);
+ }
+ log_print ("sysdep_sa_len: unknown sa family %d", sa->sa_family);
+ return sizeof (struct sockaddr_in);
+}
+
/* As regress/ use this file I protect the sysdep_app_* stuff like this. */
#ifdef NEED_SYSDEP_APP
int