INN commit: branches/2.4/innd (status.c)
INN Commit
Russ_Allbery at isc.org
Sun Aug 3 07:55:21 UTC 2008
Date: Sunday, August 3, 2008 @ 00:55:20
Author: iulius
Revision: 7947
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:
branches/2.4/innd/status.c
----------+
status.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
Modified: status.c
===================================================================
--- status.c 2008-08-03 07:50:03 UTC (rev 7946)
+++ status.c 2008-08-03 07:55:20 UTC (rev 7947)
@@ -153,9 +153,14 @@
status = xmalloc(sizeof(STATUS));
peers++; /* a new peer */
strlcpy(status->name, TempString, sizeof(status->name));
- strlcpy(status->ip_addr,
- sprint_sockaddr((struct sockaddr *)&cp->Address),
- sizeof(status->ip_addr));
+ 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 {
+ strlcpy(status->ip_addr,
+ sprint_sockaddr((struct sockaddr *)&cp->Address),
+ sizeof(status->ip_addr));
+ }
status->can_stream = cp->Streaming;
status->seconds = status->Size = status->DuplicateSize = 0;
status->Ihave = status->Ihave_Duplicate =
More information about the inn-committers
mailing list