According to msdn documentation, one is discouraged from using IP_TOS for ipv4 sockets (it apparently does not actually set anything). Also, IPV6_TCLASS does not exist in Windows. Looks like Microsoft recommends QoS2 APIs to achieve the same. Till we add those API calls, simply return on Windows.
(Noticed while running unit tests for ipv6. set_dscp would fail.) Signed-off-by: Gurucharan Shetty <gshe...@nicira.com> --- lib/socket-util.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/socket-util.c b/lib/socket-util.c index d4a9067..c0438d9 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -93,6 +93,11 @@ set_dscp(int fd, uint8_t dscp) int val; bool success; +#ifdef _WIN32 + /* XXX: Consider using QoS2 APIs for Windows to set dscp. */ + return 0; +#endif + if (dscp > 63) { return EINVAL; } @@ -101,22 +106,14 @@ set_dscp(int fd, uint8_t dscp) success = false; val = dscp << 2; if (setsockopt(fd, IPPROTO_IP, IP_TOS, &val, sizeof val)) { -#ifndef _WIN32 if (sock_errno() != ENOPROTOOPT) { -#else - if (sock_errno() != WSAENOPROTOOPT) { -#endif return sock_errno(); } } else { success = true; } if (setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &val, sizeof val)) { -#ifndef _WIN32 if (sock_errno() != ENOPROTOOPT) { -#else - if (sock_errno() != WSAENOPROTOOPT) { -#endif return sock_errno(); } } else { -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev