diff options
author | Jeffrey Hutzelman <jhutz@cmu.edu> | 2013-02-12 19:47:11 -0500 |
---|---|---|
committer | Jeffrey Hutzelman <jhutz@cmu.edu> | 2013-02-14 19:57:32 -0500 |
commit | b92153fac201a9a22779817be5f2375f7cf754fc (patch) | |
tree | a871c806708a00f8283aa95881884b5b58f0a495 | |
parent | f473694b272b517e13d14d85916c43c6b03ddda4 (diff) |
Send IPv4 addresses ASCII-encoded, not ZCode
This fixes #94
-rw-r--r-- | lib/Zinternal.c | 6 |
1 files 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; } |