From: Gurucharan Shetty Date: Mon, 17 Mar 2014 16:19:24 +0000 (-0700) Subject: socket-util: Fix dscp error check for Windows. X-Git-Tag: sliver-openvswitch-2.2.90-1~6^2~86 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=fc48c3ba3085648ecf4d6c6b0863930bba47728d;p=sliver-openvswitch.git socket-util: Fix dscp error check for Windows. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- diff --git a/lib/socket-util.c b/lib/socket-util.c index aeda5435c..5e1be3f49 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -120,14 +120,22 @@ 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 {