Now that we have a "listener", with IP & port, set the packet
authoraland <aland>
Mon, 12 Apr 2004 17:24:36 +0000 (17:24 +0000)
committeraland <aland>
Mon, 12 Apr 2004 17:24:36 +0000 (17:24 +0000)
dst IP and port, so that we can do better comparisons of them.

src/main/radiusd.c

index 9743949..b389729 100644 (file)
@@ -1344,6 +1344,21 @@ int main(int argc, char *argv[])
                                continue;
                        }
 
+                       /*
+                        *      If the destination IP is unknown, check
+                        *      if the listener has a known IP.  If so,
+                        *      use that.
+                        */
+                       if ((packet->dst_ipaddr == htonl(INADDR_ANY)) &&
+                           (packet->dst_ipaddr != listener->ipaddr)) {
+                               packet->dst_ipaddr = listener->ipaddr;
+                       }
+
+                       /*
+                        *      Fill in the destination port.
+                        */
+                       packet->dst_port = listener->port;
+
                        RAD_SNMP_TYPE_INC(listener, total_requests);
 
                        /*