aboutsummaryrefslogtreecommitdiff
path: root/net/ntp/files
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2014-12-22 06:41:29 +0000
committerCy Schubert <cy@FreeBSD.org>2014-12-22 06:41:29 +0000
commitc68b94d6f11233e2941fc21a14e8fb7708e9170f (patch)
tree92685832efa549f101481c0dfd0b902a9397eb32 /net/ntp/files
parent3cdace3d567dd8ff37a9daa3c4578995ba1dd468 (diff)
downloadports-c68b94d6f11233e2941fc21a14e8fb7708e9170f.tar.gz
ports-c68b94d6f11233e2941fc21a14e8fb7708e9170f.zip
Properly address IPV6 loopback check.
Submitted by: jmg (via twitter)
Notes
Notes: svn path=/head/; revision=375210
Diffstat (limited to 'net/ntp/files')
-rw-r--r--net/ntp/files/patch-include__ntp_net.h28
-rw-r--r--net/ntp/files/patch-ntpd__ntp_io.c22
2 files changed, 22 insertions, 28 deletions
diff --git a/net/ntp/files/patch-include__ntp_net.h b/net/ntp/files/patch-include__ntp_net.h
deleted file mode 100644
index e431baf24eb2..000000000000
--- a/net/ntp/files/patch-include__ntp_net.h
+++ /dev/null
@@ -1,28 +0,0 @@
---- include/ntp_net.h.orig 2014-12-19 03:56:52.000000000 -0800
-+++ include/ntp_net.h 2014-12-19 16:21:51.050264459 -0800
-@@ -5,6 +5,11 @@
- #ifndef NTP_NET_H
- #define NTP_NET_H
-
-+/* XXX obtained from /usr/include/netinet6/in6.h */
-+#define s6_addr8 __u6_addr.__u6_addr8
-+#define s6_addr16 __u6_addr.__u6_addr16
-+#define s6_addr32 __u6_addr.__u6_addr32
-+
- #include <sys/types.h>
- #ifdef HAVE_SYS_SOCKET_H
- #include <sys/socket.h>
-@@ -29,6 +34,13 @@
- struct sockaddr sa;
- struct sockaddr_in sa4;
- struct sockaddr_in6 sa6;
-+/* XXX obtained from /usr/include/netinet6/in6.h */
-+ union {
-+ uint8_t __u6_addr8[16];
-+ uint16_t __u6_addr16[8];
-+ uint32_t __u6_addr32[4];
-+ } __u6_addr; /* 128-bit IP6 address */
-+
- } sockaddr_u;
-
- /*
diff --git a/net/ntp/files/patch-ntpd__ntp_io.c b/net/ntp/files/patch-ntpd__ntp_io.c
new file mode 100644
index 000000000000..cf1486fa9252
--- /dev/null
+++ b/net/ntp/files/patch-ntpd__ntp_io.c
@@ -0,0 +1,22 @@
+--- ntpd/ntp_io.c.orig 2014-12-19 03:56:55.000000000 -0800
++++ ntpd/ntp_io.c 2014-12-21 22:36:02.977441698 -0800
+@@ -3454,15 +3454,15 @@
+ if (AF_INET6 == itf->family) {
+ DPRINTF(1, ("Got an IPv6 packet, from <%s> (%d) to <%s> (%d)\n",
+ stoa(&rb->recv_srcadr),
+- IN6_IS_ADDR_LOOPBACK(&rb->recv_srcadr),
++ IN6_IS_ADDR_LOOPBACK(&rb->recv_srcadr.sa6.sin6_addr),
+ stoa(&itf->sin),
+- !IN6_IS_ADDR_LOOPBACK(&itf->sin)
++ !IN6_IS_ADDR_LOOPBACK(&itf->sin.sa6.sin6_addr)
+ ));
+ }
+
+ if ( AF_INET6 == itf->family
+- && IN6_IS_ADDR_LOOPBACK(&rb->recv_srcadr)
+- && !IN6_IS_ADDR_LOOPBACK(&itf->sin)
++ && IN6_IS_ADDR_LOOPBACK(&rb->recv_srcadr.sa6.sin6_addr)
++ && !IN6_IS_ADDR_LOOPBACK(&itf->sin.sa6.sin6_addr)
+ ) {
+ packets_dropped++;
+ DPRINTF(1, ("DROPPING that packet\n"));