Configure the NAT-T port via sysctl on Mac OS X to enable handling of incoming UDP encapsulated ESP packets in the kernel.
This commit is contained in:
@@ -34,6 +34,9 @@
|
|||||||
#include <netinet/ip6.h>
|
#include <netinet/ip6.h>
|
||||||
#include <netinet/udp.h>
|
#include <netinet/udp.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <sys/sysctl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "socket.h"
|
#include "socket.h"
|
||||||
|
|
||||||
@@ -612,6 +615,18 @@ socket_t *socket_create()
|
|||||||
this->ipv4_natt = 0;
|
this->ipv4_natt = 0;
|
||||||
this->ipv6_natt = 0;
|
this->ipv6_natt = 0;
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
{
|
||||||
|
int natt_port = IKEV2_NATT_PORT;
|
||||||
|
if (sysctlbyname("net.inet.ipsec.esp_port", NULL, NULL, &natt_port,
|
||||||
|
sizeof(natt_port)) != 0)
|
||||||
|
{
|
||||||
|
DBG1(DBG_NET, "could not set net.inet.ipsec.esp_port to %d: %s",
|
||||||
|
natt_port, strerror(errno));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
this->ipv4 = open_socket(this, AF_INET, IKEV2_UDP_PORT);
|
this->ipv4 = open_socket(this, AF_INET, IKEV2_UDP_PORT);
|
||||||
if (this->ipv4 == 0)
|
if (this->ipv4 == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user