kernel-pfkey: use an int to set esp_port with a sysctl on OS X
authorMartin Willi <martin@revosec.ch>
Thu, 18 Apr 2013 14:53:35 +0000 (16:53 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 6 May 2013 14:10:12 +0000 (16:10 +0200)
src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c

index b1320f7..1fd22ab 100644 (file)
@@ -2548,8 +2548,10 @@ METHOD(kernel_ipsec_t, enable_udp_decap, bool,
                return FALSE;
        }
 #else /* __APPLE__ */
-       if (sysctlbyname("net.inet.ipsec.esp_port", NULL, NULL, &port,
-                                        sizeof(port)) != 0)
+       int intport = port;
+
+       if (sysctlbyname("net.inet.ipsec.esp_port", NULL, NULL, &intport,
+                                        sizeof(intport)) != 0)
        {
                DBG1(DBG_KNL, "could not set net.inet.ipsec.esp_port to %d: %s",
                         port, strerror(errno));