INN commit: trunk/innd (status.c)

INN Commit Russ_Allbery at isc.org
Sat Jul 5 12:14:34 UTC 2008


    Date: Saturday, July 5, 2008 @ 05:14:33
  Author: iulius
Revision: 7931

Fix a bug in the IP address displayed for localhost in innd's
status file.  It was not correctly initialized (it is a local
connection which does not use any IP address).

Modified:
  trunk/innd/status.c

----------+
 status.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Modified: status.c
===================================================================
--- status.c	2008-07-05 11:10:05 UTC (rev 7930)
+++ status.c	2008-07-05 12:14:33 UTC (rev 7931)
@@ -155,10 +155,15 @@
     }
     if (status == NULL) {
       status = xmalloc(sizeof(STATUS));
-      peers++;                                              /* a new peer */
+      peers++;                                              /* A new peer. */
       strlcpy(status->name, TempString, sizeof(status->name));
-      network_sockaddr_sprint(status->ip_addr, sizeof(status->ip_addr),
-                              (struct sockaddr *) &cp->Address);
+      if (cp->Address.ss_family == 0) {
+          /* Connections from lc.c do not have an IP address. */
+          memset(&status->ip_addr, 0, sizeof(status->ip_addr));
+      } else {
+          network_sockaddr_sprint(status->ip_addr, sizeof(status->ip_addr),
+                                  (struct sockaddr *) &cp->Address);
+      }
       status->can_stream = cp->Streaming;
       status->seconds = status->Size = status->DuplicateSize = 0;
       status->RejectSize = 0;



More information about the inn-committers mailing list