#include <netinet/in.h>
#include <arpa/inet.h>
-#ifdef __APPLE__
-#include <System/net/pfkeyv2.h>
-#else
#include <net/pfkeyv2.h>
-#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#endif
#include <err.h>
-#include <sys/ioctl.h>
-#include <resolv.h>
+#include <sys/ioctl.h>
#include "libpfkey.h"
#include "sockmisc.h"
#include "racoonctl.h"
-#include "admin.h"
#include "schedule.h"
#include "isakmp_var.h"
#include "isakmp.h"
#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;
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;
}
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;
/*
* 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;
}