From: Arran Cudbard-Bell Date: Fri, 6 Nov 2020 02:32:10 +0000 (-0600) Subject: Always build with udpfromto X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9b15652dec812c5c332e801336025e2de486e952;p=thirdparty%2Ffreeradius-server.git Always build with udpfromto --- diff --git a/configure b/configure index 635f599851c..789d4dcd7f4 100755 --- a/configure +++ b/configure @@ -762,7 +762,6 @@ with_logdir with_radacctdir with_raddbdir with_dictdir -with_udpfromto with_cap with_cap_lib_dir with_cap_include_dir @@ -1463,7 +1462,6 @@ Optional Packages: --with-radacctdir=DIR directory for detail files LOGDIR/radacct --with-raddbdir=DIR directory for config files SYSCONFDIR/raddb --with-dictdir=DIR directory for dictionary files DATAROOTDIR/freeradius - --with-udpfromto compile in support for udpfromto (default=yes) --with-cap build with cap if available (default=yes) --with-cap-lib-dir=DIR directory in which to look for cap library files --with-cap-include-dir=DIR @@ -6081,36 +6079,6 @@ modconfdir='${raddbdir}/mods-config' - WITH_UDPFROMTO=yes - - -# Check whether --with-udpfromto was given. -if test "${with_udpfromto+set}" = set; then : - withval=$with_udpfromto; case "$withval" in - yes|no|'') - ;; - no|'') - ;; - *) - as_fn_error $? "--with[out]-udpfromto expects yes|no" "$LINENO" 5 - ;; - esac -fi - - - if test x"$withval" == x"yes"; then - -$as_echo "#define WITH_UDPFROMTO 1" >>confdefs.h - - else - -$as_echo "#define WITH_UDPFROMTO /**/" >>confdefs.h - - fi - - - - WITH_CAP=yes diff --git a/configure.ac b/configure.ac index f88f91f8fa5..bd7a89de948 100644 --- a/configure.ac +++ b/configure.ac @@ -653,14 +653,6 @@ AC_MSG_RESULT($dictdir) modconfdir='${raddbdir}/mods-config' AC_SUBST(modconfdir) -dnl ############################################################# -dnl # -dnl # 0d. Enable/disable build time features -dnl # -dnl ############################################################# - -AX_WITH_FEATURE_ARGS([udpfromto],[yes]) - dnl ############################################################# dnl # dnl # 0e. Library/include paths diff --git a/src/include/autoconf.h.in b/src/include/autoconf.h.in index 2ab954c43db..c52c989b211 100644 --- a/src/include/autoconf.h.in +++ b/src/include/autoconf.h.in @@ -639,9 +639,6 @@ /* define if the server was built with -DNDEBUG */ #undef WITH_NDEBUG -/* define if you want udpfromto */ -#undef WITH_UDPFROMTO - /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD diff --git a/src/lib/server/auth.c b/src/lib/server/auth.c index 666c5a88fd2..43d953c1c87 100644 --- a/src/lib/server/auth.c +++ b/src/lib/server/auth.c @@ -185,7 +185,7 @@ runit: */ void common_packet_debug(request_t *request, fr_radius_packet_t *packet, bool received) { -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION char if_name[IFNAMSIZ]; #endif @@ -194,7 +194,7 @@ void common_packet_debug(request_t *request, fr_radius_packet_t *packet, bool re log_request(L_DBG, L_DBG_LVL_1, request, __FILE__, __LINE__, "%s code %u Id %i from %s%pV%s:%i to %s%pV%s:%i " -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION "%s%s%s" #endif "length %zu", @@ -209,7 +209,7 @@ void common_packet_debug(request_t *request, fr_radius_packet_t *packet, bool re fr_box_ipaddr(packet->socket.inet.dst_ipaddr), packet->socket.inet.dst_ipaddr.af == AF_INET6 ? "]" : "", packet->socket.inet.dst_port, -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION packet->socket.inet.ifindex ? "via " : "", packet->socket.inet.ifindex ? fr_ifname_from_ifindex(if_name, packet->socket.inet.ifindex) : "", packet->socket.inet.ifindex ? " " : "", diff --git a/src/lib/server/client.c b/src/lib/server/client.c index d11f0d10f47..87a1a4d438e 100644 --- a/src/lib/server/client.c +++ b/src/lib/server/client.c @@ -833,7 +833,6 @@ RADCLIENT *client_afrom_cs(TALLOC_CTX *ctx, CONF_SECTION *cs, CONF_SECTION *serv * request. */ if (cl_srcipaddr) { -#ifdef WITH_UDPFROMTO switch (c->ipaddr.af) { case AF_INET: if (fr_inet_pton4(&c->src_ipaddr, cl_srcipaddr, -1, true, false, true) < 0) { @@ -852,9 +851,6 @@ RADCLIENT *client_afrom_cs(TALLOC_CTX *ctx, CONF_SECTION *cs, CONF_SECTION *serv cf_log_err(cs, "ipaddr was not defined"); goto error; } -#else - WARN("Server not built with udpfromto, ignoring client src_ipaddr"); -#endif cl_srcipaddr = NULL; } diff --git a/src/lib/server/protocol.c b/src/lib/server/protocol.c index db415f12293..eb9ce4999c5 100644 --- a/src/lib/server/protocol.c +++ b/src/lib/server/protocol.c @@ -39,7 +39,7 @@ extern "C" { */ void common_packet_debug(request_t *request, fr_radius_packet_t *packet, bool received) { -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION char if_name[IFNAMSIZ]; #endif @@ -48,7 +48,7 @@ void common_packet_debug(request_t *request, fr_radius_packet_t *packet, bool re log_request(L_DBG, L_DBG_LVL_1, request, __FILE__, __LINE__, "%s code %u Id %i from %s%pV%s:%i to %s%pV%s:%i " -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION "%s%s%s" #endif "length %zu", @@ -63,7 +63,7 @@ void common_packet_debug(request_t *request, fr_radius_packet_t *packet, bool re fr_box_ipaddr(packet->dst_ipaddr), packet->dst_ipaddr.af == AF_INET6 ? "]" : "", packet->dst_port, -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION packet->ifindex ? "via " : "", packet->ifindex ? fr_ifname_from_ifindex(if_name, packet->ifindex) : "", packet->ifindex ? " " : "", diff --git a/src/lib/util/socket.c b/src/lib/util/socket.c index 2e9b08471bf..251b4dfc5d3 100644 --- a/src/lib/util/socket.c +++ b/src/lib/util/socket.c @@ -689,7 +689,6 @@ int fr_socket_server_udp(fr_ipaddr_t const *src_ipaddr, uint16_t *src_port, char */ if (socket_dont_inherit(sockfd) < 0) goto error; -#ifdef WITH_UDPFROMTO /* * Initialize udpfromto for UDP sockets. */ @@ -697,7 +696,6 @@ int fr_socket_server_udp(fr_ipaddr_t const *src_ipaddr, uint16_t *src_port, char fr_strerror_printf("Failed initializing udpfromto: %s", fr_syserror(errno)); goto error; } -#endif /* * Make sure we don't get v4 and v6 packets on inaddr_any sockets. diff --git a/src/lib/util/udp.c b/src/lib/util/udp.c index f1f1bf31cdb..ae9fc3b1460 100644 --- a/src/lib/util/udp.c +++ b/src/lib/util/udp.c @@ -27,15 +27,6 @@ RCSID("$Id$") #include #include -/* - * This is easier than ifdef's in the function definition. - */ -#ifdef WITH_UDPFROMTO -#define UDP_UNUSED -#else -#define UDP_UNUSED UNUSED -#endif - #define FR_DEBUG_STRERROR_PRINTF if (fr_debug_lvl) fr_strerror_printf /** Send a packet via a UDP socket. @@ -51,8 +42,8 @@ RCSID("$Id$") * @param[in] dst_port of the packet. */ ssize_t udp_send(int sockfd, void *data, size_t data_len, int flags, - UDP_UNUSED int ifindex, - UDP_UNUSED fr_ipaddr_t const *src_ipaddr, UDP_UNUSED uint16_t src_port, + int ifindex, + fr_ipaddr_t const *src_ipaddr, uint16_t src_port, fr_ipaddr_t const *dst_ipaddr, uint16_t dst_port) { int rcode; @@ -70,7 +61,6 @@ ssize_t udp_send(int sockfd, void *data, size_t data_len, int flags, */ if (fr_ipaddr_to_sockaddr(dst_ipaddr, dst_port, &dst, &sizeof_dst) < 0) return -1; -#ifdef WITH_UDPFROMTO /* * And if they don't specify a source IP address, don't * use udpfromto. @@ -83,12 +73,13 @@ ssize_t udp_send(int sockfd, void *data, size_t data_len, int flags, fr_ipaddr_to_sockaddr(src_ipaddr, src_port, &src, &sizeof_src); rcode = sendfromto(sockfd, data, data_len, 0, + ifindex, (struct sockaddr *)&src, sizeof_src, - (struct sockaddr *)&dst, sizeof_dst, ifindex); - } else -#endif + (struct sockaddr *)&dst, sizeof_dst); + } else { rcode = sendto(sockfd, data, data_len, 0, (struct sockaddr *) &dst, sizeof_dst); + } } if (rcode < 0) fr_strerror_printf("udp_sendto failed: %s", fr_syserror(errno)); @@ -203,7 +194,6 @@ ssize_t udp_recv(int sockfd, void *data, size_t data_len, int flags, * Receive the packet. The OS will discard any data in the * packet after "len" bytes. */ -#ifdef WITH_UDPFROMTO if (dst_ipaddr) { slen = recvfromto(sockfd, data, data_len, sock_flags, ifindex, @@ -216,20 +206,6 @@ ssize_t udp_recv(int sockfd, void *data, size_t data_len, int flags, (struct sockaddr *)&src, &sizeof_src); if (slen <= 0) goto done; } -#else - slen = recvfrom(sockfd, data, data_len, sock_flags, - (struct sockaddr *)&src, &sizeof_src); - if (slen <= 0) goto done; - - /* - * Get the destination address, if requested. - */ - if (dst_ipaddr && (getsockname(sockfd, (struct sockaddr *)&dst, &sizeof_dst) < 0)) { - return -1; - } - - if (ifindex) *ifindex = 0; -#endif if (fr_ipaddr_from_sockaddr(&src, sizeof_src, src_ipaddr, &port) < 0) { fr_strerror_printf_push("Failed converting sockaddr to ipaddr"); diff --git a/src/lib/util/udp.h b/src/lib/util/udp.h index 10718e1fe2e..10748869c30 100644 --- a/src/lib/util/udp.h +++ b/src/lib/util/udp.h @@ -29,11 +29,9 @@ extern "C" { #include #include -#ifdef WITH_UDPFROMTO -# include -#endif #include #include +#include #define UDP_FLAGS_NONE (0) #define UDP_FLAGS_CONNECTED (1 << 0) diff --git a/src/lib/util/udpfromto.c b/src/lib/util/udpfromto.c index ebd9543229e..b7ce9759c79 100644 --- a/src/lib/util/udpfromto.c +++ b/src/lib/util/udpfromto.c @@ -27,8 +27,6 @@ RCSID("$Id$") #include -#ifdef WITH_UDPFROMTO - #ifdef HAVE_SYS_UIO_H # include #endif @@ -643,4 +641,3 @@ client: } #endif /* TESTING */ -#endif /* WITH_UDPFROMTO */ diff --git a/src/lib/util/udpfromto.h b/src/lib/util/udpfromto.h index eda4555887d..92514ab0af3 100644 --- a/src/lib/util/udpfromto.h +++ b/src/lib/util/udpfromto.h @@ -29,7 +29,6 @@ RCSIDH(udpfromto_h, "$Id$") extern "C" { #endif -#ifdef WITH_UDPFROMTO #include #include #include @@ -50,8 +49,6 @@ int sendfromto(int s, void *buf, size_t len, int flags, int ifindex, struct sockaddr *from, socklen_t fromlen, struct sockaddr *to, socklen_t tolen); -#endif - #ifdef __cplusplus } #endif diff --git a/src/modules/proto_dhcpv4/dhcpclient.c b/src/modules/proto_dhcpv4/dhcpclient.c index 76dde800b11..e10ac5e1099 100644 --- a/src/modules/proto_dhcpv4/dhcpclient.c +++ b/src/modules/proto_dhcpv4/dhcpclient.c @@ -544,7 +544,7 @@ static void dhcp_packet_debug(fr_radius_packet_t *packet, bool received) char src_ipaddr[INET6_ADDRSTRLEN]; char dst_ipaddr[INET6_ADDRSTRLEN]; -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#if defined(WITH_IFINDEX_NAME_RESOLUTION) char if_name[IFNAMSIZ]; #endif fr_pair_t *vp; @@ -558,7 +558,7 @@ static void dhcp_packet_debug(fr_radius_packet_t *packet, bool received) * This really belongs in a utility library */ printf("%s %s Id %08x from %s%s%s:%i to %s%s%s:%i " -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION "%s%s%s" #endif "length %zu\n", @@ -577,7 +577,7 @@ static void dhcp_packet_debug(fr_radius_packet_t *packet, bool received) dst_ipaddr, sizeof(dst_ipaddr)), packet->socket.inet.dst_ipaddr.af == AF_INET6 ? "]" : "", packet->socket.inet.dst_port, -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION packet->socket.inet.ifindex ? "via " : "", packet->socket.inet.ifindex ? fr_ifname_from_ifindex(if_name, packet->socket.inet.ifindex) : "", packet->socket.inet.ifindex ? " " : "", diff --git a/src/modules/proto_dhcpv4/proto_dhcpv4_process.c b/src/modules/proto_dhcpv4/proto_dhcpv4_process.c index faf1a3368e6..5bc7e3883a4 100644 --- a/src/modules/proto_dhcpv4/proto_dhcpv4_process.c +++ b/src/modules/proto_dhcpv4/proto_dhcpv4_process.c @@ -57,7 +57,7 @@ fr_dict_attr_autoload_t proto_dhcpv4_process_dict_attr[] = { static void dhcpv4_packet_debug(request_t *request, fr_radius_packet_t *packet, bool received) { int i; -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION char if_name[IFNAMSIZ]; #endif @@ -65,7 +65,7 @@ static void dhcpv4_packet_debug(request_t *request, fr_radius_packet_t *packet, if (!RDEBUG_ENABLED) return; log_request(L_DBG, L_DBG_LVL_1, request, __FILE__, __LINE__, "%s %s XID %08x from %s%pV%s:%i to %s%pV%s:%i " -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION "%s%s%s" #endif "", @@ -80,7 +80,7 @@ static void dhcpv4_packet_debug(request_t *request, fr_radius_packet_t *packet, fr_box_ipaddr(packet->socket.inet.dst_ipaddr), packet->socket.inet.dst_ipaddr.af == AF_INET6 ? "]" : "", packet->socket.inet.dst_port -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION , packet->socket.inet.ifindex ? "via " : "", packet->socket.inet.ifindex ? fr_ifname_from_ifindex(if_name, packet->socket.inet.ifindex) : "", packet->socket.inet.ifindex ? " " : "" diff --git a/src/modules/proto_dhcpv6/proto_dhcpv6_process.c b/src/modules/proto_dhcpv6/proto_dhcpv6_process.c index 80b70699c97..9ee484dc0f3 100644 --- a/src/modules/proto_dhcpv6/proto_dhcpv6_process.c +++ b/src/modules/proto_dhcpv6/proto_dhcpv6_process.c @@ -53,7 +53,7 @@ fr_dict_attr_autoload_t proto_dhcpv6_process_dict_attr[] = { */ static void dhcpv6_packet_debug(request_t *request, fr_radius_packet_t *packet, bool received) { -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION char if_name[IFNAMSIZ]; #endif @@ -61,7 +61,7 @@ static void dhcpv6_packet_debug(request_t *request, fr_radius_packet_t *packet, if (!RDEBUG_ENABLED) return; log_request(L_DBG, L_DBG_LVL_1, request, __FILE__, __LINE__, "%s %s XID %08x from %s%pV%s:%i to %s%pV%s:%i " -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION "%s%s%s" #endif "", @@ -76,7 +76,7 @@ static void dhcpv6_packet_debug(request_t *request, fr_radius_packet_t *packet, fr_box_ipaddr(packet->socket.inet.dst_ipaddr), packet->socket.inet.dst_ipaddr.af == AF_INET6 ? "]" : "", packet->socket.inet.dst_port -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION , packet->socket.inet.ifindex ? "via " : "", packet->socket.inet.ifindex ? fr_ifname_from_ifindex(if_name, packet->socket.inet.ifindex) : "", packet->socket.inet.ifindex ? " " : "" diff --git a/src/modules/proto_radius/proto_radius.c b/src/modules/proto_radius/proto_radius.c index c86c2a14b11..ad39c9727e4 100644 --- a/src/modules/proto_radius/proto_radius.c +++ b/src/modules/proto_radius/proto_radius.c @@ -463,7 +463,6 @@ static ssize_t mod_encode(void const *instance, request_t *request, uint8_t *buf if (data_len > 0) return data_len; } -#ifdef WITH_UDPFROMTO /* * Overwrite the src ip address on the outbound packet * with the one specified by the client. This is useful @@ -473,7 +472,6 @@ static ssize_t mod_encode(void const *instance, request_t *request, uint8_t *buf if (client->src_ipaddr.af != AF_UNSPEC) { request->reply->socket.inet.src_ipaddr = client->src_ipaddr; } -#endif data_len = fr_radius_encode(buffer, buffer_len, request->packet->data, client->secret, talloc_array_length(client->secret) - 1, diff --git a/src/modules/proto_vmps/proto_vmps.c b/src/modules/proto_vmps/proto_vmps.c index 23063035ba9..f0c4766d477 100644 --- a/src/modules/proto_vmps/proto_vmps.c +++ b/src/modules/proto_vmps/proto_vmps.c @@ -352,7 +352,6 @@ static ssize_t mod_encode(void const *instance, request_t *request, uint8_t *buf if (data_len > 0) return data_len; } -#ifdef WITH_UDPFROMTO /* * Overwrite the src ip address on the outbound packet * with the one specified by the client. This is useful @@ -362,7 +361,6 @@ static ssize_t mod_encode(void const *instance, request_t *request, uint8_t *buf if (client->src_ipaddr.af != AF_UNSPEC) { request->reply->socket.inet.src_ipaddr = client->src_ipaddr; } -#endif fr_cursor_talloc_iter_init(&cursor, &request->reply_pairs, fr_proto_next_encodable, dict_vmps, fr_pair_t); diff --git a/src/modules/proto_vmps/proto_vmps_process.c b/src/modules/proto_vmps/proto_vmps_process.c index b64d3a3d803..1671c9e55e4 100644 --- a/src/modules/proto_vmps/proto_vmps_process.c +++ b/src/modules/proto_vmps/proto_vmps_process.c @@ -178,8 +178,6 @@ static rlm_rcode_t mod_process(UNUSED module_ctx_t const *mctx, request_t *reque return RLM_MODULE_HANDLED; } -#if 0 -#ifdef WITH_UDPFROMTO /* * Overwrite the src ip address on the outbound packet * with the one specified by the client. @@ -187,10 +185,8 @@ static rlm_rcode_t mod_process(UNUSED module_ctx_t const *mctx, request_t *reque * and other routing issues. */ if (request->client && (request->client->src_ipaddr.af != AF_UNSPEC)) { - request->reply->src_ipaddr = request->client->src_ipaddr; + request->reply->socket.inet.src_ipaddr = request->client->src_ipaddr; } -#endif -#endif if (RDEBUG_ENABLED) common_packet_debug(request, request->reply, false); break; diff --git a/src/protocols/radius/list.c b/src/protocols/radius/list.c index 6e1421d970a..380eba45d47 100644 --- a/src/protocols/radius/list.c +++ b/src/protocols/radius/list.c @@ -773,7 +773,7 @@ void fr_packet_header_log(fr_log_t const *log, fr_radius_packet_t *packet, bool { char src_ipaddr[FR_IPADDR_STRLEN]; char dst_ipaddr[FR_IPADDR_STRLEN]; -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION char if_name[IFNAMSIZ]; #endif @@ -789,7 +789,7 @@ void fr_packet_header_log(fr_log_t const *log, fr_radius_packet_t *packet, bool if (is_radius_code(packet->code)) { fr_log(log, L_DBG, __FILE__, __LINE__, "%s %s Id %i from %s%s%s:%i to %s%s%s:%i " -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION "%s%s%s" #endif "length %zu\n", @@ -804,7 +804,7 @@ void fr_packet_header_log(fr_log_t const *log, fr_radius_packet_t *packet, bool fr_inet_ntop(dst_ipaddr, sizeof(dst_ipaddr), &packet->socket.inet.dst_ipaddr), packet->socket.inet.dst_ipaddr.af == AF_INET6 ? "]" : "", packet->socket.inet.dst_port, -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION received ? "via " : "", received ? fr_ifname_from_ifindex(if_name, packet->socket.inet.ifindex) : "", received ? " " : "", @@ -813,7 +813,7 @@ void fr_packet_header_log(fr_log_t const *log, fr_radius_packet_t *packet, bool } else { fr_log(log, L_DBG, __FILE__, __LINE__, "%s code %u Id %i from %s%s%s:%i to %s%s%s:%i " -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION "%s%s%s" #endif "length %zu\n", @@ -828,7 +828,7 @@ void fr_packet_header_log(fr_log_t const *log, fr_radius_packet_t *packet, bool fr_inet_ntop(dst_ipaddr, sizeof(dst_ipaddr), &packet->socket.inet.dst_ipaddr), packet->socket.inet.dst_ipaddr.af == AF_INET6 ? "]" : "", packet->socket.inet.dst_port, -#if defined(WITH_UDPFROMTO) && defined(WITH_IFINDEX_NAME_RESOLUTION) +#ifdef WITH_IFINDEX_NAME_RESOLUTION received ? "via " : "", received ? fr_ifname_from_ifindex(if_name, packet->socket.inet.ifindex) : "", received ? " " : "", diff --git a/src/protocols/radius/packet.c b/src/protocols/radius/packet.c index b2ecbd10c2b..ee08d3b68f3 100644 --- a/src/protocols/radius/packet.c +++ b/src/protocols/radius/packet.c @@ -28,10 +28,7 @@ RCSID("$Id$") #include #include - -#ifdef WITH_UDPFROMTO #include -#endif #include #include @@ -499,9 +496,7 @@ int fr_radius_packet_send(fr_radius_packet_t *packet, fr_radius_packet_t const * /* * If the socket is TCP, call write(). Calling sendto() - * is allowed on some platforms, but it's not nice. Even - * worse, if UDPFROMTO is defined, we *can't* use it on - * TCP sockets. So... just call write(). + * is allowed on some platforms, but it's not nice. */ if (packet->socket.proto == IPPROTO_TCP) { ssize_t rcode;