]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Addresses already inverted here
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 6 Nov 2020 17:58:08 +0000 (11:58 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 6 Nov 2020 17:58:08 +0000 (11:58 -0600)
src/protocols/radius/packet.c

index 22805ebcc65f958795df867997bfffb9cf3dd437..d1ff93c1e24a5577aa74a6c1945f797c28dac139 100644 (file)
@@ -457,8 +457,6 @@ fr_radius_packet_t *fr_radius_packet_recv(TALLOC_CTX *ctx, int fd, int flags, ui
 int fr_radius_packet_send(fr_radius_packet_t *packet, fr_radius_packet_t const *original,
                          char const *secret)
 {
-       fr_socket_t     socket;
-
        /*
         *      Maybe it's a fake packet.  Don't send it.
         */
@@ -505,16 +503,13 @@ int fr_radius_packet_send(fr_radius_packet_t *packet, fr_radius_packet_t const *
                return -1;
        }
 
-       /*
-        *      Swap src/dst address so we send the response to
-        *      the client, not ourselves.
-        */
-       fr_socket_addr_swap(&socket, &packet->socket);
-
        /*
         *      And send it on it's way.
+        *
+        *      No need to call fr_socket_addr_swap as apparently
+        *      the address is already inverted.
         */
-       return udp_send(&socket, 0, packet->data, packet->data_len);
+       return udp_send(&packet->socket, 0, packet->data, packet->data_len);
 }
 
 void _fr_radius_packet_log_hex(fr_log_t const *log, fr_radius_packet_t const *packet, char const *file, int line)