Author: cy
Date: Sun Oct 12 17:19:11 2014
New Revision: 272997
URL: https://svnweb.freebsd.org/changeset/base/272997

Log:
  MFC r272554
  
  ipfilter bug #534 destination list hashing not endian neutral
  
  Obtained from:        ipfilter CVS repo (r1.26), NetBSD CVS repo (r1.8)

Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c
==============================================================================
--- stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c Sun Oct 12 17:17:19 
2014        (r272996)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_dstlist.c Sun Oct 12 17:19:11 
2014        (r272997)
@@ -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;
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to