diff options
author | cy <cy@FreeBSD.org> | 2014-10-12 17:19:11 +0000 |
---|---|---|
committer | cy <cy@FreeBSD.org> | 2014-10-12 17:19:11 +0000 |
commit | a223c6d9ec51c46b10d0b0c19690c3e7616d5c7d (patch) | |
tree | f765078c843582f5ffc2e0b08bd847f7815fbd75 | |
parent | 159eb60806fec286063201341fe6feaa11476278 (diff) | |
download | FreeBSD-src-a223c6d9ec51c46b10d0b0c19690c3e7616d5c7d.zip FreeBSD-src-a223c6d9ec51c46b10d0b0c19690c3e7616d5c7d.tar.gz |
MFC r272554
ipfilter bug #534 destination list hashing not endian neutral
Obtained from: ipfilter CVS repo (r1.26), NetBSD CVS repo (r1.8)
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_dstlist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/contrib/ipfilter/netinet/ip_dstlist.c b/sys/contrib/ipfilter/netinet/ip_dstlist.c index d516556..dc7dacb 100644 --- a/sys/contrib/ipfilter/netinet/ip_dstlist.c +++ b/sys/contrib/ipfilter/netinet/ip_dstlist.c @@ -1193,7 +1193,7 @@ ipf_dstlist_select(fin, d) MD5Update(&ctx, (u_char *)&fin->fin_dst6, sizeof(fin->fin_dst6)); MD5Final((u_char *)hash, &ctx); - x = hash[0] % d->ipld_nodes; + x = ntohl(hash[0]) % d->ipld_nodes; sel = d->ipld_dests[x]; break; @@ -1203,7 +1203,7 @@ ipf_dstlist_select(fin, d) MD5Update(&ctx, (u_char *)&fin->fin_src6, sizeof(fin->fin_src6)); MD5Final((u_char *)hash, &ctx); - x = hash[0] % d->ipld_nodes; + x = ntohl(hash[0]) % d->ipld_nodes; sel = d->ipld_dests[x]; break; @@ -1213,7 +1213,7 @@ ipf_dstlist_select(fin, d) MD5Update(&ctx, (u_char *)&fin->fin_dst6, sizeof(fin->fin_dst6)); MD5Final((u_char *)hash, &ctx); - x = hash[0] % d->ipld_nodes; + x = ntohl(hash[0]) % d->ipld_nodes; sel = d->ipld_dests[x]; break; |