From f4f0d39bfa929f8127505d318667010750c421ca Mon Sep 17 00:00:00 2001 From: "Gerald W. Carter" Date: Wed, 26 Mar 2008 16:58:27 -0500 Subject: [PATCH 1/1] Fix a bug in the output from print_canonical_sockaddr() fix from 36f8bafbd3dee66a8.... Make sure that IPv4 addresses are not enclised in []'s. (This used to be commit 4ddf58dbdc3d74cb72788ef4a2ec7587d4948c40) --- source3/lib/util_sock.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 8ceabe19b22..30a3b83be75 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -556,11 +556,17 @@ char *print_canonical_sockaddr(TALLOC_CTX *ctx, if (ret != 0) { return NULL; } + + if (pss->ss_family != AF_INET) { #if defined(HAVE_IPV6) - dest = talloc_asprintf(ctx, "[%s]", addr); + dest = talloc_asprintf(ctx, "[%s]", addr); #else - dest = talloc_asprintf(ctx, "%s", addr); + return NULL; #endif + } else { + dest = talloc_asprintf(ctx, "%s", addr); + } + return dest; } -- 2.34.1