socket-util: Fix dscp error check for Windows.
authorGurucharan Shetty <gshetty@nicira.com>
Mon, 17 Mar 2014 16:19:24 +0000 (09:19 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Tue, 18 Mar 2014 17:45:35 +0000 (10:45 -0700)
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/socket-util.c

index aeda543..5e1be3f 100644 (file)
@@ -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 {