X-Git-Url: https://git.saurik.com/apple/ipsec.git/blobdiff_plain/d1e348cfd503b08e7d34b7683d23aae209af0a71..HEAD:/ipsec-tools/racoon/kmpstat.c diff --git a/ipsec-tools/racoon/kmpstat.c b/ipsec-tools/racoon/kmpstat.c index f4629ac..cc6cde5 100644 --- a/ipsec-tools/racoon/kmpstat.c +++ b/ipsec-tools/racoon/kmpstat.c @@ -39,11 +39,7 @@ #include #include -#ifdef __APPLE__ -#include -#else #include -#endif #include #include @@ -64,8 +60,7 @@ #include #endif #include -#include -#include +#include #include "libpfkey.h" @@ -77,7 +72,6 @@ #include "sockmisc.h" #include "racoonctl.h" -#include "admin.h" #include "schedule.h" #include "isakmp_var.h" #include "isakmp.h" @@ -88,9 +82,6 @@ #include "oakley.h" #include "handler.h" #include "pfkey.h" -#include "admin.h" -#include "evt.h" -#include "admin_var.h" #include "ipsec_doi.h" u_int32_t racoonctl_interface = RACOONCTL_INTERFACE; @@ -102,18 +93,21 @@ u_int32_t loglevel = 0; int com_init() { - struct sockaddr_un name; - - memset(&name, 0, sizeof(name)); - name.sun_family = AF_UNIX; - snprintf(name.sun_path, sizeof(name.sun_path), + union { // Wcast-align fix - force alignment of sockaddr_un + struct sockaddr_storage ss; + struct sockaddr_un name; + } u; + + memset(&u, 0, sizeof(struct sockaddr_un)); + u.name.sun_family = AF_UNIX; + snprintf(u.name.sun_path, sizeof(u.name.sun_path), "%s", adminsock_path); so = socket(AF_UNIX, SOCK_STREAM, 0); if (so < 0) return -1; - if (connect(so, (struct sockaddr *)&name, sizeof(name)) < 0) { + if (connect(so, (struct sockaddr *)&u.ss, sizeof(struct sockaddr_un)) < 0) { (void)close(so); return -1; } @@ -140,8 +134,7 @@ int com_recv(combufp) vchar_t **combufp; { - struct admin_com h, *com; - caddr_t buf; + struct admin_com h; int len; int l = 0; caddr_t p; @@ -189,21 +182,9 @@ bad1: /* * Dumb plog functions (used by sockmisc.c) */ -void -plog(int pri, const char *func, struct sockaddr *sa, const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); -} void -plogdump(pri, data, len) - int pri; - void *data; - size_t len; +plogdump_func(int pri, void *data, size_t len, const char *fmt, ...) { return; }