]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
bozo: dont lie when binding to any address
authorMichael Meffie <mmeffie@sinenomine.net>
Thu, 30 Aug 2012 15:48:34 +0000 (11:48 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 5 Dec 2012 17:55:01 +0000 (09:55 -0800)
Do not log the bosserver listening to just the loopback when it is
actaully listening on any address.  The loopback address is still
written to the bosserver.rxbind file in this case to give local
scripts an simple way to contact the bosserver.

Fixes the log message introduces in
commit 9133aa6ed3a7fe2ae55b2d3242366ae277c7f726

Reviewed-on: http://gerrit.openafs.org/8022
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 03b87dffee1383c3cd5b1fed0ac3116fd8564187)

Change-Id: I1646a1fd81440aa23589ab46108c71a67bf5f6ea
Reviewed-on: http://gerrit.openafs.org/8584
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/bozo/bosserver.c

index 562e3b799863d17685956ac435f105835ceba5ef..43a1321cab732d19de98dfdedab59e98ab3da814 100644 (file)
@@ -782,16 +782,17 @@ bozo_CreateRxBindFile(afs_uint32 host)
     char buffer[16];
     FILE *fp;
 
-    if (host == htonl(INADDR_ANY)) {
-       host = htonl(0x7f000001);
-    }
-
     afs_inet_ntoa_r(host, buffer);
     bozo_Log("Listening on %s:%d\n", buffer, AFSCONF_NANNYPORT);
     if ((fp = fopen(AFSDIR_SERVER_BOZRXBIND_FILEPATH, "w")) == NULL) {
        bozo_Log("Unable to open rxbind address file: %s, code=%d\n",
                 AFSDIR_SERVER_BOZRXBIND_FILEPATH, errno);
     } else {
+       /* If listening on any interface, write the loopback interface
+          to the rxbind file to give local scripts a usable addresss. */
+       if (host == htonl(INADDR_ANY)) {
+           afs_inet_ntoa_r(htonl(0x7f000001), buffer);
+       }
        fprintf(fp, "%s\n", buffer);
        fclose(fp);
     }