X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utilities%2Fovs-openflowd.c;h=7f79a5270666e78705aeeb96f5522b1239d4a2ab;hb=2cb0c515ea85a104a18129e3379b49c556ae4e8e;hp=c275cd6a599703b58ed65cc707fd9c4936a609e7;hpb=e3e9370bf9ee0fde67b3d94acf119cec5dc3701d;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;