Skip to content

Commit

Permalink
Remove --enable-experimental-dyndisc build config knob.
Browse files Browse the repository at this point in the history
Be aware that use of the DynamicLookupCommand configuration option
still enables code known to be buggy.
  • Loading branch information
Linus Nordberg committed Nov 1, 2016
1 parent a44e795 commit 3b3742a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 58 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 0 additions & 16 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
39 changes: 1 addition & 38 deletions radsecproxy.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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? */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
5 changes: 1 addition & 4 deletions radsecproxy.h
Original file line number Diff line number Diff line change
@@ -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 <sys/time.h>
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3b3742a

Please sign in to comment.