summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@mit.edu>2009-03-04 03:58:56 +0000
committerGravatar Karl Ramm <kcr@mit.edu>2009-03-04 03:58:56 +0000
commit87325cbd43b4e0560fae657125e3df958192fc9f (patch)
tree687f892540e0a2b0cede9dd5def0d7888251152e
parentdad31a1803fc6c57b11220b8bc2100bafb51c739 (diff)
actually set the address family on incoming addresses
-rwxr-xr-xdebian/rules2
-rw-r--r--lib/ZParseNot.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/debian/rules b/debian/rules
index c06f918..b89b655 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,6 +13,8 @@
export DH_OPTIONS
CONFIGURE_ROOT=--prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --datadir=/etc --with-ares=/usr --with-hesiod=/usr
+CFLAGS=-O -g
+
# see /usr/share/doc/autotools-dev/README.Debian.gz
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
diff --git a/lib/ZParseNot.c b/lib/ZParseNot.c
index c81ae97..f5b90cd 100644
--- a/lib/ZParseNot.c
+++ b/lib/ZParseNot.c
@@ -260,11 +260,13 @@ ZParseNotice(char *buffer,
if (ZReadZcode((unsigned char *)ptr, addrbuf, sizeof(addrbuf), &len) == ZERR_BADFIELD)
BAD_PACKET;
- if (len == sizeof(notice->z_sender_sockaddr.ip6.sin6_addr))
+ if (len == sizeof(notice->z_sender_sockaddr.ip6.sin6_addr)) {
+ notice->z_sender_sockaddr.ip6.sin6_family = AF_INET6;
memcpy(&notice->z_sender_sockaddr.ip6.sin6_addr, addrbuf, len);
- else if (len == sizeof(notice->z_sender_sockaddr.ip4.sin_addr))
+ } else if (len == sizeof(notice->z_sender_sockaddr.ip4.sin_addr)) {
+ notice->z_sender_sockaddr.ip4.sin_family = AF_INET;
memcpy(&notice->z_sender_sockaddr.ip4.sin_addr, addrbuf, len);
- else
+ } else
BAD_PACKET;
numfields--;