There are two inconsistencies with the ifconfig(8) switch(4) configuring:
1) Datapath ID is an unsigned 64 bit integer, not a signed one;
2) ifconfig(8) man pages says that the parameter is "datapath" not
"datapathid";
This diff fixes both problems and let us configure the datapath id
correctly.
ok?
Index: brconfig.c
===================================================================
RCS file: /home/obsdcvs/src/sbin/ifconfig/brconfig.c,v
retrieving revision 1.11
diff -u -p -r1.11 brconfig.c
--- brconfig.c 3 Sep 2016 17:13:48 -0000 1.11
+++ brconfig.c 17 Oct 2016 10:11:25 -0000
@@ -1051,7 +1051,7 @@ switch_datapathid(const char *arg, int d
char *endptr;
errno = 0;
- newdpid = strtoll(arg, &endptr, 0);
+ newdpid = strtoull(arg, &endptr, 0);
if (arg[0] == '\0' || endptr[0] != '\0' || errno == ERANGE)
errx(1, "invalid arg for datapath-id: %s", arg);
Index: ifconfig.c
===================================================================
RCS file: /home/obsdcvs/src/sbin/ifconfig/ifconfig.c,v
retrieving revision 1.330
diff -u -p -r1.330 ifconfig.c
--- ifconfig.c 3 Sep 2016 13:46:57 -0000 1.330
+++ ifconfig.c 17 Oct 2016 09:48:33 -0000
@@ -517,7 +517,7 @@ const struct cmd {
{ "-roaming", 0, 0, umb_roaming },
{ "patch", NEXTARG, 0, setpair },
{ "-patch", 1, 0, unsetpair },
- { "datapathid", NEXTARG, 0, switch_datapathid },
+ { "datapath", NEXTARG, 0, switch_datapathid },
{ "portno", NEXTARG2, 0, NULL, switch_portno },
{ "addlocal", NEXTARG, 0, addlocal },
#else /* SMALL */