Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src #534 destination list hashing not endian neutral



details:   https://anonhg.NetBSD.org/src/rev/4c157469e997
branches:  trunk
changeset: 796946:4c157469e997
user:      darrenr <darrenr%NetBSD.org@localhost>
date:      Sat Jun 28 07:59:26 2014 +0000

description:
#534 destination list hashing not endian neutral

diffstat:

 external/bsd/ipf/dist/ip_dstlist.c        |  8 ++++----
 sys/external/bsd/ipf/netinet/ip_dstlist.c |  8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (72 lines):

diff -r 7564c719d804 -r 4c157469e997 external/bsd/ipf/dist/ip_dstlist.c
--- a/external/bsd/ipf/dist/ip_dstlist.c        Sat Jun 28 07:01:51 2014 +0000
+++ b/external/bsd/ipf/dist/ip_dstlist.c        Sat Jun 28 07:59:26 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_dstlist.c,v 1.2 2012/07/22 14:27:35 darrenr Exp $   */
+/*     $NetBSD: ip_dstlist.c,v 1.3 2014/06/28 07:59:26 darrenr Exp $   */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -1195,7 +1195,7 @@
                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;
 
@@ -1205,7 +1205,7 @@
                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;
 
@@ -1215,7 +1215,7 @@
                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;
 
diff -r 7564c719d804 -r 4c157469e997 sys/external/bsd/ipf/netinet/ip_dstlist.c
--- a/sys/external/bsd/ipf/netinet/ip_dstlist.c Sat Jun 28 07:01:51 2014 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_dstlist.c Sat Jun 28 07:59:26 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_dstlist.c,v 1.7 2014/04/01 15:19:29 christos Exp $  */
+/*     $NetBSD: ip_dstlist.c,v 1.8 2014/06/28 07:59:26 darrenr Exp $   */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -1141,7 +1141,7 @@
                MD5Update(&ctx, (u_char *)&fin->fin_dst6,
                          sizeof(fin->fin_dst6));
                MD5Final(h.bytes, &ctx);
-               x = h.hash[0] % d->ipld_nodes;
+               x = ntohl(h.hash[0]) % d->ipld_nodes;
                sel = d->ipld_dests[x];
                break;
 
@@ -1151,7 +1151,7 @@
                MD5Update(&ctx, (u_char *)&fin->fin_src6,
                          sizeof(fin->fin_src6));
                MD5Final(h.bytes, &ctx);
-               x = h.hash[0] % d->ipld_nodes;
+               x = ntohl(h.hash[0]) % d->ipld_nodes;
                sel = d->ipld_dests[x];
                break;
 
@@ -1161,7 +1161,7 @@
                MD5Update(&ctx, (u_char *)&fin->fin_dst6,
                          sizeof(fin->fin_dst6));
                MD5Final(h.bytes, &ctx);
-               x = h.hash[0] % d->ipld_nodes;
+               x = ntohl(h.hash[0]) % d->ipld_nodes;
                sel = d->ipld_dests[x];
                break;
 



Home | Main Index | Thread Index | Old Index