lkml.org 
[lkml]   [2000]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPatch: Changing route table size (RT_HASH_DIVISOR) is broken in 2.2
We needed to change the route table size (RT_HASH_DIVISOR) and found a small
problem in the inlined function 'rt_hash_code'. That function used a numeric
'0xff' instead of 'RT_HASH_DIVISOR-1'. Heres the patch (against 2.2.16) for
net/ipv4/route.c:


--- net/ipv4/route.c.bad Tue Jul 4 07:01:41 2000
+++ net/ipv4/route.c Tue Jun 13 20:46:41 2000
@@ -183,7 +183,7 @@
unsigned hash = ((daddr&0xF0F0F0F0)>>4)|((daddr&0x0F0F0F0F)<<4);
hash = hash^saddr^tos;
hash = hash^(hash>>16);
- return (hash^(hash>>8)) & 0xFF;
+ return (hash^(hash>>8)) & (RT_HASH_DIVISOR-1);
}

#ifdef CONFIG_PROC_FS

I haven't checked 2.4 sources but it may be broken there too...

Thanks,
Ben McCann

--
---
Ben McCann Indus River Networks
31 Nagog Park
Acton, MA, 01720
email: bmccann@indusriver.com web: www.indusriver.com
phone: (978) 266-8140 fax: (978) 266-8111
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.024 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site