]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
warning on possible truncation
authorAlan T. DeKok <aland@freeradius.org>
Tue, 16 Feb 2016 16:49:13 +0000 (11:49 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 16 Feb 2016 16:49:13 +0000 (11:49 -0500)
src/main/listen.c
src/main/tls_listen.c

index 4abd9fa132043a3259523390674ae0e5160c08a1..7d27cc3a646e0afcf7b4ae61d02b05aa52d15c30 100644 (file)
@@ -1322,6 +1322,11 @@ static int auth_socket_send(rad_listen_t *listener, REQUEST *request)
                return -1;
        }
 
+       if (request->reply->data_len > (MAX_PACKET_LEN - 100)) {
+               RWARN("Packet is large, and possibly truncated - %zd vs max %zd",
+                     request->reply->data_len, MAX_PACKET_LEN);
+       }
+
        return 0;
 }
 
@@ -1362,6 +1367,11 @@ static int acct_socket_send(rad_listen_t *listener, REQUEST *request)
                return -1;
        }
 
+       if (request->reply->data_len > (MAX_PACKET_LEN - 100)) {
+               RWARN("Packet is large, and possibly truncated - %zd vs max %zd",
+                     request->reply->data_len, MAX_PACKET_LEN);
+       }
+
        return 0;
 }
 #endif
@@ -1384,6 +1394,11 @@ static int proxy_socket_send(rad_listen_t *listener, REQUEST *request)
                return -1;
        }
 
+       if (request->proxy->data_len > (MAX_PACKET_LEN - 100)) {
+               RWARN("Packet is large, and possibly truncated - %zd vs max %zd",
+                     request->proxy->data_len, MAX_PACKET_LEN);
+       }
+
        return 0;
 }
 #endif
@@ -2095,6 +2110,11 @@ static int client_socket_encode(UNUSED rad_listen_t *listener, REQUEST *request)
                return -1;
        }
 
+       if (request->reply->data_len > (MAX_PACKET_LEN - 100)) {
+               RWARN("Packet is large, and possibly truncated - %zd vs max %zd",
+                     request->reply->data_len, MAX_PACKET_LEN);
+       }
+
        if (rad_sign(request->reply, request->packet, request->client->secret) < 0) {
                RERROR("Failed signing packet: %s", fr_strerror());
 
@@ -2149,6 +2169,11 @@ static int proxy_socket_encode(UNUSED rad_listen_t *listener, REQUEST *request)
                return -1;
        }
 
+       if (request->proxy->data_len > (MAX_PACKET_LEN - 100)) {
+               RWARN("Packet is large, and possibly truncated - %zd vs max %zd",
+                     request->proxy->data_len, MAX_PACKET_LEN);
+       }
+
        if (rad_sign(request->proxy, NULL, request->home_server->secret) < 0) {
                RERROR("Failed signing proxied packet: %s", fr_strerror());
 
index fd4273e3ef01ed968cd4169ab3593a000394597d..2ff1b8d8d25c90a05fef885239ab44853d12ebf5 100644 (file)
@@ -437,6 +437,11 @@ int dual_tls_send(rad_listen_t *listener, REQUEST *request)
                return 0;
        }
 
+       if (request->reply->data_len > (MAX_PACKET_LEN - 100)) {
+               RWARN("Packet is large, and possibly truncated - %zd vs max %zd",
+                     request->reply->data_len, MAX_PACKET_LEN);
+       }
+
        /*
         *      Sign the packet.
         */