Fix INTERFACE_ADD parsing

This fixes a regression caused by commit
efa232f915 ('Add support for virtual
interface creation/deletion') for the case where an empty extra argument
is included.

Signed-off-by: Ben Greear <greearb@candelatech.com>
This commit is contained in:
Ben Greear 2015-04-03 19:34:33 -04:00 committed by Jouni Malinen
parent 6812782462
commit da3db6812d

View file

@ -8593,10 +8593,17 @@ static int wpa_supplicant_global_iface_add(struct wpa_global *global,
pos = os_strchr(pos, '\t'); pos = os_strchr(pos, '\t');
if (pos) if (pos)
*pos++ = '\0'; *pos++ = '\0';
if (!extra[0])
break;
if (os_strcmp(extra, "create") == 0) if (os_strcmp(extra, "create") == 0)
create_iface = 1; create_iface = 1;
else else {
wpa_printf(MSG_DEBUG,
"INTERFACE_ADD unsupported extra parameter: '%s'",
extra);
return -1; return -1;
}
} while (0); } while (0);
if (create_iface) { if (create_iface) {