From 62eb41a8bf4be835265df15f0183a4682a71ba31 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 11 Apr 2012 13:30:30 +0200 Subject: Don't cry and die on a configured server (!) which doesn't resolve (DNS). Just cry some. Part of fixing RADSECPROXY-30. --- util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index dc36ed9..b9b27e8 100644 --- a/util.c +++ b/util.c @@ -114,7 +114,7 @@ char *addr2string(struct sockaddr *addr) { RADIUS packet to be discarded on first attempt (due to Path MTU discovery). */ -void disable_DF_bit(int socket, struct addrinfo *res) { +void disable_DF_bit(int socket, const struct addrinfo *res) { if ((res->ai_family == AF_INET) && (res->ai_socktype == SOCK_DGRAM)) { #if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) /* @@ -132,11 +132,11 @@ void disable_DF_bit(int socket, struct addrinfo *res) { } } -int bindtoaddr(struct addrinfo *addrinfo, int family, int reuse, int v6only) { +int bindtoaddr(const struct addrinfo *addrinfo, int family, int reuse, int v6only) { int s, on = 1; - struct addrinfo *res; + const struct addrinfo *res = addrinfo; - for (res = addrinfo; res; res = res->ai_next) { + for (; res; res = res->ai_next) { if (family != AF_UNSPEC && family != res->ai_family) continue; s = socket(res->ai_family, res->ai_socktype, res->ai_protocol); -- cgit v1.1