learning-switch: Delay sending handshake until version negotiation is done.
[openvswitch] / lib / socket-util.c
index 5fe9f98ba2fd9bc2c71793891f9a2fa876fbc503..314761d388adf7c08c645f1d5937bec0eacd3a24 100644 (file)
@@ -94,12 +94,14 @@ xset_nonblocking(int fd)
 static int
 set_dscp(int fd, uint8_t dscp)
 {
+    int val;
+
     if (dscp > 63) {
         return EINVAL;
     }
 
-    dscp = dscp << 2;
-    if (setsockopt(fd, IPPROTO_IP, IP_TOS, &dscp, sizeof dscp)) {
+    val = dscp << 2;
+    if (setsockopt(fd, IPPROTO_IP, IP_TOS, &val, sizeof val)) {
         return errno;
     }
 
@@ -180,7 +182,7 @@ lookup_ipv6(const char *host_name, struct in6_addr *addr)
  * Most Open vSwitch code should not use this because it causes deadlocks:
  * gethostbyname() sends out a DNS request but that starts a new flow for which
  * OVS must set up a flow, but it can't because it's waiting for a DNS reply.
- * The synchronous lookup also delays other activty.  (Of course we can solve
+ * The synchronous lookup also delays other activity.  (Of course we can solve
  * this but it doesn't seem worthwhile quite yet.)  */
 int
 lookup_hostname(const char *host_name, struct in_addr *addr)