summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGerald W. Carter <jerry@samba.org>2008-03-26 16:58:27 -0500
committerGerald W. Carter <jerry@samba.org>2008-03-26 16:58:27 -0500
commitf4f0d39bfa929f8127505d318667010750c421ca (patch)
tree42ff4f9b6d4858476a4b4f32081ff83896cde1e4 /source3/lib
parent06772e7f6561d32e9cc7b15811815e3368b2beae (diff)
downloadsamba-f4f0d39bfa929f8127505d318667010750c421ca.tar.gz
samba-f4f0d39bfa929f8127505d318667010750c421ca.tar.bz2
samba-f4f0d39bfa929f8127505d318667010750c421ca.zip
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)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_sock.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 8ceabe19b2..30a3b83be7 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;
}