vswitchd: Initial conversion to database-based configuration.
[openvswitch] / utilities / ovs-openflowd.c
index c275cd6a599703b58ed65cc707fd9c4936a609e7..7f79a5270666e78705aeeb96f5522b1239d4a2ab 100644 (file)
@@ -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;