From f13eaa0172320387bfa12cca2c6c1abbc1ce72c4 Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Thu, 30 Aug 2012 11:48:34 -0400 Subject: [PATCH] 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 Reviewed-on: http://gerrit.openafs.org/8022 Tested-by: BuildBot Reviewed-by: Jeffrey Altman (cherry picked from commit 03b87dffee1383c3cd5b1fed0ac3116fd8564187) Change-Id: I1646a1fd81440aa23589ab46108c71a67bf5f6ea Reviewed-on: http://gerrit.openafs.org/8584 Tested-by: BuildBot Reviewed-by: Ken Dreyer Tested-by: Ken Dreyer Reviewed-by: Paul Smeddle Reviewed-by: Stephan Wiesand --- src/bozo/bosserver.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index 562e3b799..43a1321ca 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -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); } -- 2.39.5