From b92153fac201a9a22779817be5f2375f7cf754fc Mon Sep 17 00:00:00 2001 From: Jeffrey Hutzelman Date: Tue, 12 Feb 2013 19:47:11 -0500 Subject: Send IPv4 addresses ASCII-encoded, not ZCode This fixes #94 --- lib/Zinternal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Zinternal.c b/lib/Zinternal.c index 0f692f3..87d6e91 100644 --- a/lib/Zinternal.c +++ b/lib/Zinternal.c @@ -947,13 +947,15 @@ Z_ZcodeFormatRawHeader(ZNotice_t *notice, if (notice->z_sender_sockaddr.sa.sa_family == AF_INET) { addrlen = sizeof(notice->z_sender_sockaddr.ip4.sin_addr); addraddr = (unsigned char *)¬ice->z_sender_sockaddr.ip4.sin_addr; + if (ZMakeAscii(ptr, end-ptr, addraddr, addrlen) == ZERR_FIELDLEN) + return ZERR_HEADERLEN; } else if (notice->z_sender_sockaddr.sa.sa_family == AF_INET6) { addrlen = sizeof(notice->z_sender_sockaddr.ip6.sin6_addr); addraddr = (unsigned char *)¬ice->z_sender_sockaddr.ip6.sin6_addr; + if (ZMakeZcode(ptr, end-ptr, addraddr, addrlen) == ZERR_FIELDLEN) + return ZERR_HEADERLEN; } - if (ZMakeZcode(ptr, end-ptr, addraddr, addrlen) == ZERR_FIELDLEN) - return ZERR_HEADERLEN; ptr += strlen(ptr) + 1; } -- cgit v1.2.3