X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=utilities%2Fovs-openflowd.c;h=7f79a5270666e78705aeeb96f5522b1239d4a2ab;hb=e073f944f58df72091db46fad0bef76715d30f5d;hp=c275cd6a599703b58ed65cc707fd9c4936a609e7;hpb=58fda1dab104041fc693032475ec4662c1a52849;p=openvswitch diff --git a/utilities/ovs-openflowd.c b/utilities/ovs-openflowd.c index c275cd6a..7f79a527 100644 --- a/utilities/ovs-openflowd.c +++ b/utilities/ovs-openflowd.c @@ -345,14 +345,9 @@ parse_options(int argc, char *argv[], struct ofsettings *s) switch (c) { case OPT_DATAPATH_ID: - if (strlen(optarg) != 12 - || strspn(optarg, "0123456789abcdefABCDEF") != 12) { + if (!dpid_from_string(optarg, &s->datapath_id)) { ovs_fatal(0, "argument to --datapath-id must be " - "exactly 12 hex digits"); - } - s->datapath_id = strtoll(optarg, NULL, 16); - if (!s->datapath_id) { - ovs_fatal(0, "argument to --datapath-id must be nonzero"); + "exactly 12 hex digits and may not be all-zero"); } break;