From: Gerald W. Carter Date: Wed, 26 Mar 2008 21:58:27 +0000 (-0500) Subject: Fix a bug in the output from print_canonical_sockaddr() fix from 36f8bafbd3dee66a8.... X-Git-Tag: samba-3.3.0pre1~3094 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ddf58dbdc3d74cb72788ef4a2ec7587d4948c40;p=thirdparty%2Fsamba.git Fix a bug in the output from print_canonical_sockaddr() fix from 36f8bafbd3dee66a8.... Make sure that IPv4 addresses are not enclised in []'s. --- diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c index 8ceabe19b22..30a3b83be75 100644 --- a/source/lib/util_sock.c +++ b/source/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; }