X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utilities%2Fovs-ofctl.c;h=e873ed7ba2a41567057290ddae5eeddbbf4d6832;hb=1125a1b9dc3ffe95bddafa7f85a95d0e337c01ca;hp=a39e99fcf3ac78052cee4cc6667c9b9791f3bcff;hpb=c228a3649af653a1b2109871b7b1f6ab76a841b7;p=openvswitch diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index a39e99fc..e873ed7b 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -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);