summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvenaas <venaas>2008-08-14 12:56:32 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-08-14 12:56:32 +0000
commitb1b22afb6aa95920d33e740fb74699efd1e5fb4e (patch)
tree2726210bf74b3fa2108a567b241318bc4966a453
parentff253938ad9e1181065b53e32133df3ca18036e1 (diff)
seems need to use select with MSG_PEEK
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@340 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r--radsecproxy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index 0311029..e934d55 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -721,8 +721,13 @@ unsigned char *radudpget(int s, struct client **client, struct server **server,
socklen_t fromlen = sizeof(from);
struct clsrvconf *p;
struct list_node *node;
+ fd_set readfds;
for (;;) {
+ FD_ZERO(&readfds);
+ FD_SET(s, &readfds);
+ if (select(s + 1, &readfds, NULL, NULL, NULL) < 1)
+ continue;
cnt = recvfrom(s, buf, 4, MSG_PEEK, (struct sockaddr *)&from, &fromlen);
if (cnt == -1) {
debug(DBG_WARN, "radudpget: recv failed");