Signed-off-by: John Crispin <blogic@openwrt.org>
c->authprotocol = htole32(MBIM_AUTH_PROTOCOL_CHAP);
else if (!strcmp(_argv[1], "mschapv2"))
c->authprotocol = htole32(MBIM_AUTH_PROTOCOL_MSCHAPV2);
- else
- return -1;
- mbim_encode_string(&c->username, _argv[2]);
- mbim_encode_string(&c->password, _argv[3]);
+ if (c->authprotocol) {
+ mbim_encode_string(&c->username, _argv[2]);
+ mbim_encode_string(&c->password, _argv[3]);
+ }
}
return mbim_send_command_msg();
}