iproute/iproute2-2.6.16-ip_resolve_crash.patch

15 lines
592 B
Diff
Raw Normal View History

diff -up iproute-2.6.23/iproute2-2.6.23/lib/utils.c.ee iproute-2.6.23/iproute2-2.6.23/lib/utils.c
--- iproute-2.6.23/iproute2-2.6.23/lib/utils.c.ee 2007-10-16 23:27:42.000000000 +0200
+++ iproute-2.6.23/iproute2-2.6.23/lib/utils.c 2007-10-31 09:26:20.000000000 +0100
@@ -503,8 +503,8 @@ char *resolve_address(const char *addr,
2006-09-19 12:01:54 +00:00
len = 4;
}
- hash = addr[len-1] ^ addr[len-2] ^ addr[len-3] ^ addr[len-4];
-
2006-09-19 12:01:54 +00:00
+ hash = (addr[len-1] ^ addr[len-2] ^ addr[len-3] ^ addr[len-4]) & 0xff;
+
2006-09-19 12:01:54 +00:00
for (n = nht[hash]; n; n = n->next) {
if (n->addr.family == af &&
n->addr.bytelen == len &&