diff options
author | Linus Nordberg <linus@nordu.net> | 2012-04-11 13:30:30 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2012-04-11 13:30:30 +0200 |
commit | 62eb41a8bf4be835265df15f0183a4682a71ba31 (patch) | |
tree | 16c06fc992aa2dd07e9898d8051f3a4c3ba74bd4 /udp.c | |
parent | d40144aec7a0bf59a05f236102bf094363caa32e (diff) |
Don't cry and die on a configured server (!) which doesn't resolve (DNS). Just cry some.postpone-resolving
Part of fixing RADSECPROXY-30.
Diffstat (limited to 'udp.c')
-rw-r--r-- | udp.c | 26 |
1 files changed, 4 insertions, 22 deletions
@@ -25,6 +25,7 @@ #include <regex.h> #include <pthread.h> #include "radsecproxy.h" +#include "common.h" #include "hostport.h" #ifdef RADPROT_UDP @@ -36,7 +37,7 @@ static char **getlistenerargs(); void *udpserverrd(void *arg); int clientradputudp(struct server *server, unsigned char *rad); void addclientudp(struct client *client); -void addserverextraudp(struct clsrvconf *conf); +int addserverextraudp(const struct clsrvconf *conf); void udpsetsrcres(); void initextraudp(); @@ -316,27 +317,8 @@ void addclientudp(struct client *client) { client->replyq = server_replyq; } -void addserverextraudp(struct clsrvconf *conf) { - switch (((struct hostportres *)list_first(conf->hostports)->data)->addrinfo->ai_family) { - case AF_INET: - if (client4_sock < 0) { - client4_sock = bindtoaddr(srcres, AF_INET, 0, 1); - if (client4_sock < 0) - debugx(1, DBG_ERR, "addserver: failed to create client socket for server %s", conf->name); - } - conf->servers->sock = client4_sock; - break; - case AF_INET6: - if (client6_sock < 0) { - client6_sock = bindtoaddr(srcres, AF_INET6, 0, 1); - if (client6_sock < 0) - debugx(1, DBG_ERR, "addserver: failed to create client socket for server %s", conf->name); - } - conf->servers->sock = client6_sock; - break; - default: - debugx(1, DBG_ERR, "addserver: unsupported address family"); - } +int addserverextraudp(const struct clsrvconf *conf) { + return addserverextra(conf, &client4_sock, &client6_sock, srcres); } void initextraudp() { |