From 007cc230a68daa6785f28a979e67ad9e67b1c87a Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Mon, 17 Dec 2007 22:38:56 -0500 Subject: [PATCH] Prefer "bind_address" for local addresses over "address". src/mod-qserver.c (qserver_conf_read): Check for "bind_address" option before "address" option. src/mod-sockcheck.c (sockcheck_read_conf): Likewise. srvx.conf.example: Update config examples to match. --- src/mod-qserver.c | 4 +++- src/mod-sockcheck.c | 3 ++- srvx.conf.example | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mod-qserver.c b/src/mod-qserver.c index 451e196..cc91924 100644 --- a/src/mod-qserver.c +++ b/src/mod-qserver.c @@ -183,7 +183,9 @@ qserver_conf_read(void) node = conf_get_data("modules/qserver", RECDB_OBJECT); if (!node) return; - str1 = database_get_data(node, "address", RECDB_QSTRING); + str1 = database_get_data(node, "bind_address", RECDB_QSTRING); + if (!str1) + str1 = database_get_data(node, "address", RECDB_QSTRING); str2 = database_get_data(node, "port", RECDB_QSTRING); if (!str2) return; diff --git a/src/mod-sockcheck.c b/src/mod-sockcheck.c index d5888da..0d216ae 100644 --- a/src/mod-sockcheck.c +++ b/src/mod-sockcheck.c @@ -1147,7 +1147,8 @@ sockcheck_read_conf(void) if (str) sockcheck_conf.max_cache_age = ParseInterval(str); str = database_get_data(my_node, "gline_duration", RECDB_QSTRING); if (str) sockcheck_conf.gline_duration = ParseInterval(str); - str = database_get_data(my_node, "address", RECDB_QSTRING); + str = database_get_data(my_node, "bind_address", RECDB_QSTRING); + if (!str) str = database_get_data(my_node, "address", RECDB_QSTRING); if (!getaddrinfo(str, NULL, NULL, &ai)) { sockcheck_conf.local_addr_len = ai->ai_addrlen; sockcheck_conf.local_addr = calloc(1, ai->ai_addrlen); diff --git a/srvx.conf.example b/srvx.conf.example index 6b9ed18..d5ea362 100644 --- a/srvx.conf.example +++ b/srvx.conf.example @@ -283,7 +283,7 @@ "max_read" "1024"; // don't read more than 1024 bytes from any client "gline_duration" "1h"; // issue G-lines lasting one hour "max_cache_age" "60"; // only cache results for 60 seconds - // "address" "192.168.0.10"; // do proxy tests from this address + // "bind_address" "192.168.0.10"; // do proxy tests from this address }; "snoop" { // Where to send snoop messages? @@ -299,7 +299,7 @@ // to 0 to disable message expiration }; "qserver" { - "address" "127.0.0.1"; + "bind_address" "127.0.0.1"; "port" "7702"; "password" "hello"; }; -- 2.20.1