bozo: dont lie when binding to any address
authorMichael Meffie <mmeffie@sinenomine.net>
Thu, 30 Aug 2012 15:48:34 +0000 (11:48 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 5 Sep 2012 02:39:45 +0000 (19:39 -0700)
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

Change-Id: I48f3ff5a1f9a20881df11a41baf3da29e1d02576
Reviewed-on: http://gerrit.openafs.org/8022
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/bozo/bosserver.c

index 9ab975b..31b52eb 100644 (file)
@@ -767,16 +767,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);
     }