From: Alan T. DeKok Date: Tue, 19 May 2020 23:00:26 +0000 (-0400) Subject: remove more unused variables X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3bf718b43a86beaffcdf7350473b02ab9962680;p=thirdparty%2Ffreeradius-server.git remove more unused variables --- diff --git a/src/modules/proto_control/proto_control_tcp.c b/src/modules/proto_control/proto_control_tcp.c index e7dfc964101..4803402878c 100644 --- a/src/modules/proto_control/proto_control_tcp.c +++ b/src/modules/proto_control/proto_control_tcp.c @@ -207,7 +207,6 @@ static int mod_open(fr_listen_t *li) int sockfd; uint16_t port = inst->port; - CONF_ITEM *ci; fr_assert(!inst->connection); @@ -232,11 +231,6 @@ static int mod_open(fr_listen_t *li) inst->sockfd = sockfd; - ci = cf_parent(inst->cs); /* listen { ... } */ - fr_assert(ci != NULL); - ci = cf_parent(ci); - fr_assert(ci != NULL); - inst->name = fr_app_io_socket_name(inst, &proto_control_tcp, NULL, 0, &inst->ipaddr, inst->port); diff --git a/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c b/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c index ab4bc3f8143..bd6d5e2b416 100644 --- a/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c +++ b/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c @@ -461,7 +461,6 @@ static int mod_open(fr_listen_t *li) int sockfd, rcode; uint16_t port = inst->port; - CONF_ITEM *ci; li->fd = sockfd = fr_socket_server_udp(&inst->ipaddr, &port, inst->port_name, true); if (sockfd < 0) { @@ -496,12 +495,7 @@ static int mod_open(fr_listen_t *li) } } - /* - * SUID up is really only needed if interface is set, OR port <1024. - */ - rad_suid_up(); rcode = fr_socket_bind(sockfd, &inst->ipaddr, &port, inst->interface); - rad_suid_down(); if (rcode < 0) { close(sockfd); PERROR("Failed binding socket"); @@ -510,11 +504,6 @@ static int mod_open(fr_listen_t *li) thread->sockfd = sockfd; - ci = cf_parent(inst->cs); /* listen { ... } */ - fr_assert(ci != NULL); - ci = cf_parent(ci); - fr_assert(ci != NULL); - thread->name = fr_app_io_socket_name(thread, &proto_dhcpv4_udp, NULL, 0, &inst->ipaddr, inst->port, diff --git a/src/modules/proto_dhcpv6/proto_dhcpv6_udp.c b/src/modules/proto_dhcpv6/proto_dhcpv6_udp.c index ad7e9d1d0b5..4caf3f6ec83 100644 --- a/src/modules/proto_dhcpv6/proto_dhcpv6_udp.c +++ b/src/modules/proto_dhcpv6/proto_dhcpv6_udp.c @@ -300,7 +300,6 @@ static int mod_open(fr_listen_t *li) int sockfd, rcode; uint16_t port = inst->port; - CONF_ITEM *ci; li->fd = sockfd = fr_socket_server_udp(&inst->ipaddr, &port, inst->port_name, true); if (sockfd < 0) { @@ -384,11 +383,6 @@ static int mod_open(fr_listen_t *li) thread->sockfd = sockfd; - ci = cf_parent(inst->cs); /* listen { ... } */ - fr_assert(ci != NULL); - ci = cf_parent(ci); - fr_assert(ci != NULL); - thread->name = fr_app_io_socket_name(thread, &proto_dhcpv6_udp, NULL, 0, &inst->ipaddr, inst->port, diff --git a/src/modules/proto_radius/proto_radius_load.c b/src/modules/proto_radius/proto_radius_load.c index 5ce567999ac..b4cbfe24663 100644 --- a/src/modules/proto_radius/proto_radius_load.c +++ b/src/modules/proto_radius/proto_radius_load.c @@ -210,7 +210,6 @@ static int mod_open(fr_listen_t *li) proto_radius_load_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_radius_load_thread_t); fr_ipaddr_t ipaddr; - CONF_ITEM *ci; if (socketpair(AF_UNIX, SOCK_STREAM, 0, (int *) &thread->sockets) < 0) { PERROR("Failed opening /dev/null: %s", fr_syserror(errno)); @@ -223,11 +222,6 @@ static int mod_open(fr_listen_t *li) ipaddr.af = AF_INET; li->app_io_addr = fr_app_io_socket_addr(li, IPPROTO_UDP, &ipaddr, 0); - ci = cf_parent(inst->cs); /* listen { ... } */ - fr_assert(ci != NULL); - ci = cf_parent(ci); - fr_assert(ci != NULL); - thread->name = talloc_typed_asprintf(thread, "radius_load from filename %s", inst->filename ? inst->filename : "none"); thread->parent = talloc_parent(li); diff --git a/src/modules/proto_radius/proto_radius_tcp.c b/src/modules/proto_radius/proto_radius_tcp.c index 71b904b42d5..488e7084583 100644 --- a/src/modules/proto_radius/proto_radius_tcp.c +++ b/src/modules/proto_radius/proto_radius_tcp.c @@ -290,7 +290,6 @@ static int mod_open(fr_listen_t *li) int sockfd; uint16_t port = inst->port; - CONF_ITEM *ci; fr_assert(!thread->connection); @@ -315,11 +314,6 @@ static int mod_open(fr_listen_t *li) thread->sockfd = sockfd; - ci = cf_parent(inst->cs); /* listen { ... } */ - fr_assert(ci != NULL); - ci = cf_parent(ci); - fr_assert(ci != NULL); - thread->name = fr_app_io_socket_name(thread, &proto_radius_tcp, NULL, 0, &inst->ipaddr, inst->port, diff --git a/src/modules/proto_radius/proto_radius_udp.c b/src/modules/proto_radius/proto_radius_udp.c index 7bd7247dbba..20c923f07c2 100644 --- a/src/modules/proto_radius/proto_radius_udp.c +++ b/src/modules/proto_radius/proto_radius_udp.c @@ -299,7 +299,6 @@ static int mod_open(fr_listen_t *li) int sockfd; uint16_t port = inst->port; - CONF_ITEM *ci; li->fd = sockfd = fr_socket_server_udp(&inst->ipaddr, &port, inst->port_name, true); if (sockfd < 0) { @@ -353,11 +352,6 @@ static int mod_open(fr_listen_t *li) thread->sockfd = sockfd; - ci = cf_parent(inst->cs); /* listen { ... } */ - fr_assert(ci != NULL); - ci = cf_parent(ci); - fr_assert(ci != NULL); - thread->name = fr_app_io_socket_name(thread, &proto_radius_udp, NULL, 0, &inst->ipaddr, inst->port, diff --git a/src/modules/proto_vmps/proto_vmps_udp.c b/src/modules/proto_vmps/proto_vmps_udp.c index b501f493869..d44c96dba0d 100644 --- a/src/modules/proto_vmps/proto_vmps_udp.c +++ b/src/modules/proto_vmps/proto_vmps_udp.c @@ -305,7 +305,6 @@ static int mod_open(fr_listen_t *li) int sockfd; uint16_t port = inst->port; - CONF_ITEM *ci; li->fd = sockfd = fr_socket_server_udp(&inst->ipaddr, &port, inst->port_name, true); if (sockfd < 0) { @@ -337,11 +336,6 @@ static int mod_open(fr_listen_t *li) thread->sockfd = sockfd; - ci = cf_parent(inst->cs); /* listen { ... } */ - fr_assert(ci != NULL); - ci = cf_parent(ci); - fr_assert(ci != NULL); - thread->name = fr_app_io_socket_name(thread, &proto_vmps_udp, NULL, 0, &inst->ipaddr, inst->port,