mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-10 14:23:36 -05:00
Fixup BSD port.
git-svn-id: file:///svn/unbound/trunk@1401 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
159c7e4d6c
commit
1bdf2b2b6a
2 changed files with 13 additions and 2 deletions
|
|
@ -4,6 +4,7 @@
|
|||
- follows -rc makedist from ldns changes (no _rc).
|
||||
- ldns tarball updated with 1.4.1rc for DLV unit test.
|
||||
- verbose prints about recursion lame detection and server selection.
|
||||
- fixup BSD port for infra host storage. It hashed wrongly.
|
||||
|
||||
17 December 2008: Wouter
|
||||
- follows ldns makedist.sh. -rc option. autom4te dir removed.
|
||||
|
|
|
|||
14
services/cache/infra.c
vendored
14
services/cache/infra.c
vendored
|
|
@ -136,8 +136,18 @@ static hashvalue_t
|
|||
hash_addr(struct sockaddr_storage* addr, socklen_t addrlen)
|
||||
{
|
||||
hashvalue_t h = 0xab;
|
||||
h = hashlittle(&addrlen, sizeof(addrlen), h);
|
||||
h = hashlittle(addr, addrlen, h);
|
||||
/* select the pieces to hash, some OS have changing data inside */
|
||||
if(addr_is_ip6(addr, addrlen)) {
|
||||
struct sockaddr_in6* in6 = (struct sockaddr_in6*)addr;
|
||||
h = hashlittle(&in6->sin6_family, sizeof(in6->sin6_family), h);
|
||||
h = hashlittle(&in6->sin6_port, sizeof(in6->sin6_port), h);
|
||||
h = hashlittle(&in6->sin6_addr, INET6_SIZE, h);
|
||||
} else {
|
||||
struct sockaddr_in* in = (struct sockaddr_in*)addr;
|
||||
h = hashlittle(&in->sin_family, sizeof(in->sin_family), h);
|
||||
h = hashlittle(&in->sin_port, sizeof(in->sin_port), h);
|
||||
h = hashlittle(&in->sin_addr, INET_SIZE, h);
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue