projects
/
oweals
/
uhttpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d83bd3
)
Accept square bracket notation for IPv6 addresses
author
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 17 Apr 2013 11:30:19 +0000
(13:30 +0200)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Wed, 17 Apr 2013 11:30:19 +0000
(13:30 +0200)
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index f88506cca812b5a947aed360912ab63dbacbb4ea..ce51db9b801093b7a56dd5027848dcb70c8fd8ae 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-103,6
+103,7
@@
static int add_listener_arg(char *arg, bool tls)
char *host = NULL;
char *port = arg;
char *s;
+ int l;
s = strrchr(arg, ':');
if (s) {
@@
-111,6
+112,14
@@
static int add_listener_arg(char *arg, bool tls)
*s = 0;
}
+ if (host && *host == '[') {
+ l = strlen(host);
+ if (l >= 2) {
+ host[l-1] = 0;
+ host++;
+ }
+ }
+
return uh_socket_bind(host, port, tls);
}