]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
show more errors
authorAlan T. DeKok <aland@freeradius.org>
Thu, 9 Nov 2017 16:10:18 +0000 (11:10 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 9 Nov 2017 16:10:18 +0000 (11:10 -0500)
src/modules/proto_radius/proto_radius_udp.c

index 8b66f5eafcf39ed162dfa9a715022bd99c40af75..cca5cd1546cac24c0f9dd0a91087629a02d10552 100644 (file)
@@ -231,11 +231,16 @@ static ssize_t mod_read(void *instance, void **packet_ctx, fr_time_t **recv_time
                             &address.src_ipaddr, &address.src_port,
                             &address.dst_ipaddr, &address.dst_port,
                             &address.if_index, &timestamp);
-       if (data_size <= 0) {
-               DEBUG2("proto_radius_udp got read error %zd", data_size);
+       if (data_size < 0) {
+               DEBUG2("proto_radius_udp got read error %zd: %s", data_size, fr_strerror());
                return data_size;
        }
 
+       if (!data_size) {
+               DEBUG2("proto_radius_udp got no data: ignoring");
+               return 0;
+       }
+
        packet_len = data_size;
 
        if (data_size < 20) {