This command:

        # ifconfig iwm0 join 0x61626163a                             
        ifconfig: bad hexadecimal digits

ends up adding "" to the joinlist, i.e. it has the same effect as

        ifconfig iwm0 join ""

This happens because A_JOIN gets set even on invalid input.

setifjoin sets this flag after validating input, but we also ask ifconfig's
generic command machinery to set it, which causes this bug.

ok?

diff c20bd74017ceeadb2db0f78a352ed1f1e2b77c2b /usr/src
blob - e1dc9dbb07bf109c3ec7f5fd4d851a7dbb5692f1
file + sbin/ifconfig/ifconfig.c
--- sbin/ifconfig/ifconfig.c
+++ sbin/ifconfig/ifconfig.c
@@ -400,7 +400,7 @@ const struct        cmd {
        { "mtu",        NEXTARG,        0,              setifmtu },
        { "nwid",       NEXTARG,        0,              setifnwid },
        { "-nwid",      -1,             0,              setifnwid },
-       { "join",       NEXTARG,        A_JOIN,         setifjoin },
+       { "join",       NEXTARG,        0,              setifjoin },
        { "-join",      NEXTARG,        0,              delifjoin },
        { "joinlist",   NEXTARG0,       0,              showjoin },
        { "-joinlist",  -1,             0,              delifjoinlist },

Reply via email to