From 3b3742a9f5fb087674bd448636c06f011f81e8d7 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 20 Oct 2016 11:50:55 +0200 Subject: Remove --enable-experimental-dyndisc build config knob. Be aware that use of the DynamicLookupCommand configuration option still enables code known to be buggy. --- ChangeLog | 3 +++ configure.ac | 16 ---------------- radsecproxy.c | 39 +-------------------------------------- radsecproxy.h | 5 +---- 4 files changed, 5 insertions(+), 58 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad93072..6247aa4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ Changes between 1.6.8 and the master branch Misc: - libnettle is now an unconditional dependency. - FTicks support is now on by default and not optional. + - Experimental code for dynamic discovery has been removed. Be + aware that use of the DynamicLookupCommand configuration option + still enables code known to be buggy. Bug fixes: - Detect the presence of docbook2x-man correctly. diff --git a/configure.ac b/configure.ac index 9ca9b78..85643ea 100644 --- a/configure.ac +++ b/configure.ac @@ -90,22 +90,6 @@ if test "x$dtls" = "xyes" ; then TARGET_CFLAGS="$TARGET_CFLAGS -DRADPROT_DTLS" fi -AC_ARG_ENABLE( - experimental_dyndisc, - AC_HELP_STRING([--enable-experimental-dyndisc], - [enable experimental code for dynamic discovery [default=no]]), - [case $enableval in - yes|no) ;; - *) AC_MSG_ERROR([bad value $enableval for --enable-experimental-dyndisc, need yes or no]) ;; - esac], - [enable_experimental_dyndisc=no]) -if test "$enable_experimental_dyndisc" = "yes"; then - AC_DEFINE([ENABLE_EXPERIMENTAL_DYNDISC], [1]) -fi -AM_CONDITIONAL(ENABLE_EXPERIMENTAL_DYNDISC, - test "$enable_experimental_dyndisc" = "yes") - - AC_ARG_VAR([DOCBOOK2X_MAN], [docbook2x-man program to use]) if test -z "$DOCBOOK2X_MAN" ; then AC_SUBST([DOCBOOK2X_MAN], [docbook2x-man]) diff --git a/radsecproxy.c b/radsecproxy.c index a4d8c07..7efebed 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -1,5 +1,5 @@ /* Copyright (c) 2007-2009, UNINETT AS - * Copyright (c) 2010-2013,2015 NORDUnet A/S */ + * Copyright (c) 2010-2013,2015-2016, NORDUnet A/S */ /* See LICENSE for licensing information. */ /* For UDP there is one server instance consisting of udpserverrd and udpserverth @@ -301,10 +301,6 @@ void freeserver(struct server *server, uint8_t destroymutex) { freebios(server->rbios); free(server->dynamiclookuparg); if (server->ssl) { -#if defined ENABLE_EXPERIMENTAL_DYNDISC - if (server->sock >= 0) - close(server->sock); -#endif SSL_free(server->ssl); } if (destroymutex) { @@ -710,12 +706,7 @@ int hasdynamicserver(struct list *srvconfs) { struct list_node *entry; for (entry = list_first(srvconfs); entry; entry = list_next(entry)) -#if defined ENABLE_EXPERIMENTAL_DYNDISC - if (((struct clsrvconf *)entry->data)->dynamiclookupcommand - || ((struct clsrvconf *)entry->data)->servers->in_use) -#else if (((struct clsrvconf *)entry->data)->dynamiclookupcommand) -#endif return 1; return 0; } @@ -1766,17 +1757,11 @@ void *clientwr(void *arg) { dynconffail = 1; server->dynstartup = 0; server->dynfailing = 1; -#if defined ENABLE_EXPERIMENTAL_DYNDISC - pthread_mutex_unlock(&server->lock); -#endif debug(DBG_WARN, "%s: dynamicconfig(%s: %s) failed, sleeping %ds", __func__, server->conf->name, server->dynamiclookuparg, ZZZ); sleep(ZZZ); goto errexit; } -#if defined ENABLE_EXPERIMENTAL_DYNDISC - pthread_mutex_unlock(&server->lock); -#endif /* FIXME: Is resolving not always done by compileserverconfig(), * either as part of static configuration setup or by * dynamicconfig() above? */ @@ -1805,9 +1790,6 @@ void *clientwr(void *arg) { goto errexit; } server->connectionok = 1; -#if defined ENABLE_EXPERIMENTAL_DYNDISC - server->in_use = 1; -#endif if (pthread_create(&clientrdth, &pthread_attr, conf->pdef->clientconnreader, (void *)server)) { debugerrno(errno, DBG_ERR, "clientwr: pthread_create failed"); goto errexit; @@ -1917,9 +1899,6 @@ void *clientwr(void *arg) { } } errexit: -#if defined ENABLE_EXPERIMENTAL_DYNDISC - server->in_use = 0; -#endif conf->servers = NULL; if (server->dynamiclookuparg) { removeserversubrealms(realms, conf); @@ -2203,29 +2182,13 @@ struct list *createsubrealmservers(struct realm *realm, struct list *srvconfs) { srvconf->servers->dynstartup = 1; debug(DBG_DBG, "%s: new client writer for %s", __func__, srvconf->servers->conf->name); -#if defined ENABLE_EXPERIMENTAL_DYNDISC - pthread_mutex_lock(&srvconf->servers->lock); -#endif if (pthread_create(&clientth, &pthread_attr, clientwr, (void *)(srvconf->servers))) { -#if defined ENABLE_EXPERIMENTAL_DYNDISC - pthread_mutex_unlock(&srvconf->servers->lock); -#endif debugerrno(errno, DBG_ERR, "pthread_create failed"); freeserver(srvconf->servers, 1); srvconf->servers = NULL; -#if defined ENABLE_EXPERIMENTAL_DYNDISC - conf = srvconf; - continue; -#endif } else pthread_detach(clientth); -#if defined ENABLE_EXPERIMENTAL_DYNDISC - /* If clientwr() could not find a NAPTR we have to - * wait for dynfailing=1 what is set in clientwr(). */ - pthread_mutex_lock(&srvconf->servers->lock); - pthread_mutex_unlock(&srvconf->servers->lock); -#endif } conf = srvconf; } diff --git a/radsecproxy.h b/radsecproxy.h index 982515c..244eb5c 100644 --- a/radsecproxy.h +++ b/radsecproxy.h @@ -1,5 +1,5 @@ /* Copyright (c) 2007-2009, UNINETT AS - * Copyright (c) 2010-2012, NORDUnet A/S */ + * Copyright (c) 2010-2012,2016, NORDUnet A/S */ /* See LICENSE for licensing information. */ #include @@ -169,9 +169,6 @@ struct server { uint8_t lostrqs; uint8_t dynstartup; uint8_t dynfailing; -#if defined ENABLE_EXPERIMENTAL_DYNDISC - uint8_t in_use; -#endif char *dynamiclookuparg; int nextid; struct timeval lastrcv; -- cgit v1.1