Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Oct 2014 17:19:12 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r272997 - stable/10/sys/contrib/ipfilter/netinet
Message-ID:  <201410121719.s9CHJC4G064022@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410121719.s9CHJC4G064022>