From: Alan T. DeKok Date: Tue, 4 Dec 2018 17:55:59 +0000 (-0500) Subject: remove unused macro X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e13dff69899581fe69be8e7e75519a2914ebd030;p=thirdparty%2Ffreeradius-server.git remove unused macro --- diff --git a/src/lib/io/app_io.c b/src/lib/io/app_io.c index 50cd239cc30..40d2db0f6cd 100644 --- a/src/lib/io/app_io.c +++ b/src/lib/io/app_io.c @@ -29,7 +29,8 @@ char const *fr_app_io_socket_name(TALLOC_CTX *ctx, fr_app_io_t const *app_io, fr_ipaddr_t const *src_ipaddr, int src_port, - fr_ipaddr_t const *dst_ipaddr, int dst_port) + fr_ipaddr_t const *dst_ipaddr, int dst_port, + char const *interface) { char dst_buf[128], src_buf[128]; @@ -47,14 +48,25 @@ char const *fr_app_io_socket_name(TALLOC_CTX *ctx, fr_app_io_t const *app_io, fr_value_box_snprint(dst_buf, sizeof(dst_buf), fr_box_ipaddr(*dst_ipaddr), 0); } - if (!src_ipaddr) { - return talloc_typed_asprintf(ctx, "proto_%s server %s port %u", - app_io->name, dst_buf, dst_port); + if (src_ipaddr) fr_value_box_snprint(src_buf, sizeof(src_buf), fr_box_ipaddr(*src_ipaddr), 0); + + if (!interface) { + if (!src_ipaddr) { + return talloc_typed_asprintf(ctx, "proto_%s server %s port %u", + app_io->name, dst_buf, dst_port); + } + + + return talloc_typed_asprintf(ctx, "proto_%s from client %s port %u to server %s port %u", + app_io->name, src_buf, src_port, dst_buf, dst_port); } + if (!src_ipaddr) { + return talloc_typed_asprintf(ctx, "proto_%s server %s port %u on interface %s", + app_io->name, dst_buf, dst_port, interface); + } - fr_value_box_snprint(src_buf, sizeof(src_buf), fr_box_ipaddr(*src_ipaddr), 0); - return talloc_typed_asprintf(ctx, "proto_%s from client %s port %u to server %s port %u", - app_io->name, src_buf, src_port, dst_buf, dst_port); + return talloc_typed_asprintf(ctx, "proto_%s from client %s port %u to server %s port %u on interface %s", + app_io->name, src_buf, src_port, dst_buf, dst_port, interface); } diff --git a/src/lib/io/app_io.h b/src/lib/io/app_io.h index 8589c72c3df..dd07268fd4f 100644 --- a/src/lib/io/app_io.h +++ b/src/lib/io/app_io.h @@ -78,4 +78,5 @@ typedef struct { */ char const *fr_app_io_socket_name(TALLOC_CTX *ctx, fr_app_io_t const *app_io, fr_ipaddr_t const *src_ipaddr, int src_port, - fr_ipaddr_t const *dst_ipaddr, int dst_port); + fr_ipaddr_t const *dst_ipaddr, int dst_port, + char const *interface); diff --git a/src/lib/io/network.c b/src/lib/io/network.c index d076086df82..c0c4933dec0 100644 --- a/src/lib/io/network.c +++ b/src/lib/io/network.c @@ -48,7 +48,7 @@ RCSID("$Id$") #undef DEBUG3 #undef ERROR -#define DEBUG(fmt, ...) if (nr->lvl) fr_log(nr->log, L_DBG, fmt, ## __VA_ARGS__) +//#define DEBUG(fmt, ...) if (nr->lvl) fr_log(nr->log, L_DBG, fmt, ## __VA_ARGS__) //#define DEBUG2(fmt, ...) if (nr->lvl >= L_DBG_LVL_2) fr_log(nr->log, L_DBG, fmt, ## __VA_ARGS__) #define DEBUG3(fmt, ...) if (nr->lvl >= L_DBG_LVL_3) fr_log(nr->log, L_DBG, fmt, ## __VA_ARGS__) #define ERROR(fmt, ...) fr_log(nr->log, L_ERR, fmt, ## __VA_ARGS__)