Browse Source

cleanup authprotocol handling

Signed-off-by: John Crispin <blogic@openwrt.org>
John Crispin 9 years ago
parent
commit
4ae19ab4fc
1 changed files with 4 additions and 4 deletions
  1. 4 4
      cli.c

+ 4 - 4
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();
 }