Stop using SOL_TCP, SOL_IP and SOL_IPV6.
Instead, use IPPROTO_TCP, _IP and _IPv6. This fixes an issue on OS X where it didn't create an UDP socket that listened on IPv4.
This commit is contained in:
parent
a0a8f8f81f
commit
a31e1f03c4
3 changed files with 15 additions and 20 deletions
|
|
@ -719,10 +719,10 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) {
|
|||
if(priorityinheritance && origpriority != listen_socket[sock].priority) {
|
||||
listen_socket[sock].priority = origpriority;
|
||||
switch(sa->sa.sa_family) {
|
||||
#if defined(SOL_IP) && defined(IP_TOS)
|
||||
#if defined(IPPROTO_IP) && defined(IP_TOS)
|
||||
case AF_INET:
|
||||
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Setting IPv4 outgoing packet priority to %d", origpriority);
|
||||
if(setsockopt(listen_socket[sock].udp.fd, SOL_IP, IP_TOS, &origpriority, sizeof origpriority)) /* SO_PRIORITY doesn't seem to work */
|
||||
if(setsockopt(listen_socket[sock].udp.fd, IPPROTO_IP, IP_TOS, &origpriority, sizeof origpriority)) /* SO_PRIORITY doesn't seem to work */
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "System call `%s' failed: %s", "setsockopt", sockstrerror(sockerrno));
|
||||
break;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue