Commit 2136cab8 authored by Kai Vehmanen's avatar Kai Vehmanen

Fixed stunc argument parsing. It is now possible to given STUN server address...

Fixed stunc argument parsing. It is now possible to given STUN server address as a hostname instead of requiring a dotted decimal IP-address.

darcs-hash:20060505141915-7659e-58b0260aa5e03a315bedc5b570b66ac7bb7f7421.gz
parent fbda5de7
......@@ -277,7 +277,7 @@ int main(int argc, char *argv[])
su_sockaddr_t sa[1];
su_socket_t s;
if (!argv[1] || !argv[2] || inet_pton(AF_INET, argv[1], sa) < 1)
if (argc < 3)
usage(argv[0]);
for (i = 2; argv[i]; i++) {
......@@ -289,8 +289,10 @@ int main(int argc, char *argv[])
sflags |= do_nat_check;
else if (strcmp(argv[i], "-l") == 0)
sflags |= do_life_check;
else
else {
fprintf(stderr, "Unable to parse option %s.\n", argv[i]);
usage(argv[0]);
}
}
/* Running this test requires a local STUN server on default port */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment