Prefer "bind_address" for local addresses over "address".
authorMichael Poole <mdpoole@troilus.org>
Tue, 18 Dec 2007 03:38:56 +0000 (22:38 -0500)
committerMichael Poole <mdpoole@troilus.org>
Tue, 18 Dec 2007 03:38:56 +0000 (22:38 -0500)
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
src/mod-sockcheck.c
srvx.conf.example

index 451e1969e79a96a2c6b7edc07ae2fdd1d2999bdc..cc91924490b03b735e831d9085717cce70af82db 100644 (file)
@@ -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;
index d5888da4b81e1633cf2d39743aa63789a802b301..0d216ae6e423df19e870c9623c894b40a4bd2287 100644 (file)
@@ -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);
index 6b9ed1816559e58985867ce0aae830b250cf9cc7..d5ea3629cc223bcae22409fcf3441d825288ba6c 100644 (file)
         "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?
                                 // to 0 to disable message expiration
     };
     "qserver" {
-        "address" "127.0.0.1";
+        "bind_address" "127.0.0.1";
         "port" "7702";
         "password" "hello";
     };