[NET]: Fix kernel oops if base_reachable_time is set to 0.

Linux Kernel Mailing List <[email protected]> Fri, 11 Feb 2005 03:02:10 +0000
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1562.1.2, 2005/02/10 19:02:10-08:00, [email protected]

	[NET]: Fix kernel oops if base_reachable_time is set to 0.
	
	Signed-off-by: David S. Miller <[email protected]>



 neighbour.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/net/core/neighbour.c b/net/core/neighbour.c
--- a/net/core/neighbour.c	2005-02-15 11:02:55 -08:00
+++ b/net/core/neighbour.c	2005-02-15 11:02:55 -08:00
@@ -111,7 +111,7 @@
 
 unsigned long neigh_rand_reach_time(unsigned long base)
 {
-	return (net_random() % base) + (base>>1);
+	return (base ? (net_random() % base) + (base >> 1) : 0);
 }