Skip to contentSkip to conversation

Openvpn --pass-tos on FreeBSD

PATCH New Nielsen 1 participant 1 message Nov 24, 2005

lore
Share & tools
lore

Nielsen

author
#0 lore raw

PATCH 1/1 Openvpn --pass-tos on FreeBSD

The attached patch makes the --pass-tos option work on FreeBSD. If included in OpenVPN a configure test would probably be necessary.

This is one of several things we modified in OpenVPN while evaluating it for deployment. Thought I'd share the fixes.

Cheers,
Nate Nielsen

socket.h renamed from openvpn-2.0.orig/socket.h +5 -1
diff -U3 ../openvpn-2.0.orig/socket.h ./socket.h
@@ -748,7 +755,11 @@
 link_socket_set_tos (struct link_socket *ls)
 {
   if (ls && ls->ptos_defined)
-    setsockopt (ls->sd, IPPROTO_IP, IP_TOS, &ls->ptos, sizeof (ls->ptos));
+    {
+      int tos = ls->ptos;
+      setsockopt (ls->sd, IPPROTO_IP, IP_TOS, &tos, sizeof (tos));
+    }
+
 }
 
 #endif