server now prints an error if rad_recv() returns NULL
authoraland <aland>
Mon, 30 Aug 1999 12:53:00 +0000 (12:53 +0000)
committeraland <aland>
Mon, 30 Aug 1999 12:53:00 +0000 (12:53 +0000)
corrected error messages in rad_recv()

src/lib/radius.c
src/main/radiusd.c

index 46cef91..aa34350 100644 (file)
@@ -346,7 +346,7 @@ RADIUS_PACKET *rad_recv(int fd)
         *      Check for packets smaller than the packet header.
         */
        if (packet->data_len < AUTH_HDR_LEN) {
-               librad_log("Malformed RADIUS packet from host %s: too small",
+               librad_log("Malformed RADIUS packet from host %s: too short",
                           ip_ntoa(host_ipaddr, packet->src_ipaddr));
                free(packet->data);
                free(packet);
@@ -386,8 +386,9 @@ RADIUS_PACKET *rad_recv(int fd)
        count = totallen - AUTH_HDR_LEN;
        while (count > 0) {
                        if (attr[1] < 2) {
-                       librad_log("Malformed RADIUS packet from host %s: packet attributes do NOT exactly fill the packet",
-                                  ip_ntoa(host_ipaddr, packet->src_ipaddr));
+                       librad_log("Malformed RADIUS packet from host %s: attribute %d too short",
+                                  ip_ntoa(host_ipaddr, packet->src_ipaddr),
+                                  attr[0]);
                        free(packet->data);
                        free(packet);
                        return NULL;
index 7e2b5a5..f8579a1 100644 (file)
@@ -416,7 +416,10 @@ int main(int argc, char **argv)
                                continue;
 
                        packet = rad_recv(fd);
-                       if (packet == NULL) continue;
+                       if (packet == NULL) {
+                               log(L_ERR, "%s", librad_errstr);
+                               continue;
+                       }
 
                        /*
                         *      See if we know this client.