Merge citrix branch into master.
[sliver-openvswitch.git] / utilities / ovs-ofctl.c
index a39e99f..e873ed7 100644 (file)
@@ -442,8 +442,8 @@ str_to_u32(const char *str)
 static void
 str_to_mac(const char *str, uint8_t mac[6]) 
 {
-    if (sscanf(str, "%"SCNx8":%"SCNx8":%"SCNx8":%"SCNx8":%"SCNx8":%"SCNx8,
-               &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]) != 6) {
+    if (sscanf(str, ETH_ADDR_SCAN_FMT, ETH_ADDR_SCAN_ARGS(mac))
+        != ETH_ADDR_SCAN_COUNT) {
         ovs_fatal(0, "invalid mac address %s", str);
     }
 }
@@ -617,6 +617,8 @@ str_to_action(char *str, struct ofpbuf *b)
              * packet to the controller. */
             if (arg && (strspn(act, "0123456789") == strlen(act))) {
                oao->max_len = htons(str_to_u32(arg));
+            } else {
+                oao->max_len = htons(UINT16_MAX);
             }
         } else if (parse_port_name(act, &port)) {
             put_output_action(b, port);