From: Arran Cudbard-Bell Date: Fri, 6 Nov 2020 17:58:08 +0000 (-0600) Subject: Addresses already inverted here X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bea422fd84db6334f3157f76d73a31cf489e9ea2;p=thirdparty%2Ffreeradius-server.git Addresses already inverted here --- diff --git a/src/protocols/radius/packet.c b/src/protocols/radius/packet.c index 22805ebcc65..d1ff93c1e24 100644 --- a/src/protocols/radius/packet.c +++ b/src/protocols/radius/packet.c @@ -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)