diff options
author | venaas <venaas> | 2007-01-04 14:43:53 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2007-01-04 14:43:53 +0000 |
commit | 5ff81d97c9f3c3cd189c5e387a252bcf5fbd38a7 (patch) | |
tree | 5adc53e74f52aac376b0aee3ac93516723a6b129 /util.c | |
parent | 28699bc5e546f880b466e392659c927456e40820 (diff) |
fixed minor bugs
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@27 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -71,7 +71,7 @@ char *addr2string(struct sockaddr *addr, socklen_t len) { int bindport(int type, char *port) { struct addrinfo hints, *res0, *res; - int s; + int s, one = 1; memset(&hints, 0, sizeof(hints)); hints.ai_socktype = type; @@ -85,6 +85,7 @@ int bindport(int type, char *port) { for (res = res0; res; res = res->ai_next) { s = socket(res->ai_family, res->ai_socktype, res->ai_protocol); if (s >= 0) { + setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); if (bind(s, res->ai_addr, res->ai_addrlen) == 0) break; close(s); |