From: Michael Meffie Date: Thu, 30 Aug 2012 15:48:34 +0000 (-0400) Subject: bozo: dont lie when binding to any address X-Git-Tag: upstream/1.8.0_pre1^2~2049 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=03b87dffee1383c3cd5b1fed0ac3116fd8564187;p=packages%2Fo%2Fopenafs.git bozo: dont lie when binding to any address 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 Reviewed-by: Jeffrey Altman --- diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index 9ab975b94..31b52eb68 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -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); }