Openvpn --pass-tos on FreeBSD
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
@@ -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