- addresses 0.0.0.0 and ::0 really match any (#275091, comment #28)

This commit is contained in:
Adam Tkac 2008-05-06 09:34:26 +00:00
parent e00252b251
commit b246b77488
2 changed files with 49 additions and 1 deletions

43
bind-9.5-any.patch Normal file
View File

@ -0,0 +1,43 @@
diff -up bind-9.5.0b3/lib/isc/netaddr.c.any bind-9.5.0b3/lib/isc/netaddr.c
--- bind-9.5.0b3/lib/isc/netaddr.c.any 2008-05-05 22:01:29.000000000 +0200
+++ bind-9.5.0b3/lib/isc/netaddr.c 2008-05-05 22:24:52.000000000 +0200
@@ -69,10 +69,11 @@ isc_boolean_t
isc_netaddr_eqprefix(const isc_netaddr_t *a, const isc_netaddr_t *b,
unsigned int prefixlen)
{
- const unsigned char *pa, *pb;
+ const unsigned char *pa, *pb, *pany;
unsigned int ipabytes; /* Length of whole IP address in bytes */
unsigned int nbytes; /* Number of significant whole bytes */
unsigned int nbits; /* Number of significant leftover bits */
+ isc_netaddr_t any; /* represents 0.0.0.0 or ::0 */
REQUIRE(a != NULL && b != NULL);
@@ -86,11 +87,15 @@ isc_netaddr_eqprefix(const isc_netaddr_t
case AF_INET:
pa = (const unsigned char *) &a->type.in;
pb = (const unsigned char *) &b->type.in;
+ isc_netaddr_any(&any);
+ pany = (const unsigned char *) &any.type.in;
ipabytes = 4;
break;
case AF_INET6:
pa = (const unsigned char *) &a->type.in6;
pb = (const unsigned char *) &b->type.in6;
+ isc_netaddr_any6(&any);
+ pany = (const unsigned char *) &any.type.in6;
ipabytes = 16;
break;
default:
@@ -99,6 +104,10 @@ isc_netaddr_eqprefix(const isc_netaddr_t
return (ISC_FALSE);
}
+ if (memcmp(pa, pany, ipabytes) == 0 ||
+ memcmp(pb, pany, ipabytes) == 0)
+ return (ISC_TRUE);
+
/*
* Don't crash if we get a pattern like 10.0.0.1/9999999.
*/

View File

@ -18,7 +18,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv
Name: bind
License: ISC
Version: 9.5.0
Release: 31.%{RELEASEVER}%{dist}
Release: 31.1.%{RELEASEVER}%{dist}
Epoch: 32
Url: http://www.isc.org/products/BIND/
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -59,6 +59,7 @@ Patch72: bind-9.5-dlz-64bit.patch
Patch87: bind-9.5-parallel-build.patch
Patch88: bind-9.5-libcap.patch
Patch89: bind-9.5-recv-race.patch
Patch90: bind-9.5-any.patch
# SDB patches
Patch11: bind-9.3.2b2-sdbsrc.patch
@ -239,6 +240,7 @@ cp -fp contrib/dbus/{dbus_mgr.h,dbus_service.h} bin/named/include/named
%patch85 -p1 -b .libidn3
%patch87 -p1 -b .parallel
%patch89 -p1 -b .recv-race
%patch90 -p1 -b .any
:;
@ -645,6 +647,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_sbindir}/bind-chroot-admin
%changelog
* Tue May 06 2008 Adam Tkac <atkac redhat com> 32:9.5.0-31.1.b3
- addresses 0.0.0.0 and ::0 really match any (#275091, comment #28)
* Mon May 05 2008 Adam Tkac <atkac redhat com> 32:9.5.0-31.b3
- readded bind-9.5-libcap.patch
- added bind-9.5-recv-race.patch from F8 branch (#400461)