do NOT close proxyfd in the accounting child, as it still
authoraland <aland>
Fri, 17 Dec 1999 19:35:28 +0000 (19:35 +0000)
committeraland <aland>
Fri, 17 Dec 1999 19:35:28 +0000 (19:35 +0000)
needs to send proxied accounting requests.

However, we ONLY need to listen to proxy replies in the main
server.  The accounting server SHOULD NOT look for proxy replies,
or we'll have two processes doing a recv() on the same FD.

src/main/radiusd.c

index 44304cc..6549bfc 100644 (file)
@@ -482,8 +482,6 @@ int main(int argc, char **argv)
                else {
                        close(sockfd);
                        sockfd = -1;
-                       close(proxyfd);
-                       proxyfd = -1;
                }
        } else
                log(L_INFO, "Ready to process requests.");
@@ -500,12 +498,17 @@ int main(int argc, char **argv)
                }
 
                FD_ZERO(&readfds);
-               if (sockfd >= 0)
+               if (sockfd >= 0) {
                        FD_SET(sockfd, &readfds);
+                       /*
+                        *      ONLY listen for proxy replies in the
+                        *      main server, NOT the accounting server!
+                        */
+                       if (proxyfd >= 0)
+                               FD_SET(proxyfd, &readfds);
+               }
                if (acctfd >= 0)
                        FD_SET(acctfd, &readfds);
-               if (proxyfd >= 0)
-                       FD_SET(proxyfd, &readfds);
 
                status = select(32, &readfds, NULL, NULL, NULL);
                if (status == -1) {