Browse code

Fix parameter type for IP_TOS setsockopt on non-Linux systems.

Linux uses uint8_t, all BSD based stacks and Solaris use "int" (Windows
documentation says "DWORD" and "do not use, use QoS API instead").

Bug reported and fix provided by Torsten Vielhak and Jeremie Le Hen.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 20121219212619.GN22465@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/7207
Signed-off-by: David Sommerseth <davids@redhat.com>

Gert Doering authored on 2012/12/20 06:12:41
Showing 1 changed files
... ...
@@ -237,7 +237,11 @@ struct link_socket
237 237
 
238 238
 #if PASSTOS_CAPABILITY
239 239
   /* used to get/set TOS. */
240
+#if defined(TARGET_LINUX)
240 241
   uint8_t ptos;
242
+#else /* all the BSDs, Solaris, MacOS use plain "int" -> see "man ip" there */
243
+  int  ptos;
244
+#endif
241 245
   bool ptos_defined;
242 246
 #endif
243 247