patch-2.0.30 linux/net/ipv4/route.c

Next file: linux/net/ipv4/sysctl_net_ipv4.c
Previous file: linux/net/ipv4/raw.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.29/linux/net/ipv4/route.c linux/net/ipv4/route.c
@@ -564,11 +564,14 @@
 			f1 = fz->fz_list;
 			while (f1)
 			{
-				struct fib_node * next;
+				struct fib_node * next, **end;
 				unsigned hash = fz_hash_code(f1->fib_dst, logmask);
 				next = f1->fib_next;
-				f1->fib_next = ht[hash];
-				ht[hash] = f1;
+				f1->fib_next = NULL;
+				end = &ht[hash];
+				while(*end != NULL)
+					end = &(*end)->fib_next;
+				*end = f1;
 				f1 = next;
 			}
 			fz->fz_list = NULL;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov