patch-2.1.91 linux/net/ipv6/ip6_fib.c

Next file: linux/net/ipv6/ip6_output.c
Previous file: linux/net/ipv6/icmp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.90/linux/net/ipv6/ip6_fib.c linux/net/ipv6/ip6_fib.c
@@ -5,7 +5,7 @@
  *	Authors:
  *	Pedro Roque		<roque@di.fc.ul.pt>	
  *
- *	$Id: ip6_fib.c,v 1.11 1998/03/08 05:56:50 davem Exp $
+ *	$Id: ip6_fib.c,v 1.12 1998/03/20 09:12:16 davem Exp $
  *
  *	This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -418,9 +418,13 @@
 			    (iter->rt6i_flowr == rt->rt6i_flowr) &&
 			    (ipv6_addr_cmp(&iter->rt6i_gateway,
 					   &rt->rt6i_gateway) == 0)) {
-				if (rt->rt6i_expires == 0 ||
-				    (long)(rt->rt6i_expires - iter->rt6i_expires) > 0)
-					rt->rt6i_expires = iter->rt6i_expires;
+				if (!(iter->rt6i_flags&RTF_EXPIRES))
+					return -EEXIST;
+				iter->rt6i_expires = rt->rt6i_expires;
+				if (!(rt->rt6i_flags&RTF_EXPIRES)) {
+					iter->rt6i_flags &= ~RTF_EXPIRES;
+					iter->rt6i_expires = rt->rt6i_expires;
+				}
 				return -EEXIST;
 			}
 		}
@@ -931,7 +935,8 @@
 		 *	Seems, radix tree walking is absolutely broken,
 		 *	but we will try in any case --ANK
 		 */
-		if (rt->rt6i_expires && (long)(now - rt->rt6i_expires) < 0) {
+		if ((rt->rt6i_flags&RTF_EXPIRES) && rt->rt6i_expires
+		    && (long)(now - rt->rt6i_expires) > 0) {
 			struct rt6_info *old;
 
 			old = rt;

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