Commit b1b22afb authored by venaas's avatar venaas Committed by venaas
Browse files

seems need to use select with MSG_PEEK

git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@340 e88ac4ed-0b26-0410-9574-a7f39faa03bf
parent ff253938
......@@ -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");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment