From: John Crispin Date: Mon, 8 Sep 2014 00:01:58 +0000 (+0200) Subject: cleanup authprotocol handling X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=4ae19ab4fcdd70dbfc8c303d752502f2da5a7e75;hp=7741d88cdfd36f0c4380f660a9ad7109df76b432;p=project%2Fumbim.git cleanup authprotocol handling Signed-off-by: John Crispin --- diff --git a/cli.c b/cli.c index d3c11d3..17809c2 100644 --- a/cli.c +++ b/cli.c @@ -323,11 +323,11 @@ mbim_connect_request(void) 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(); }