From 38ca17a83c93ce3a52c1d5ed57ed09111ba51f94 Mon Sep 17 00:00:00 2001 From: Mike Karels Date: Tue, 10 Apr 1984 21:17:26 -0800 Subject: [PATCH] minor efficiency SCCS-vsn: sbin/routed/input.c 4.8 --- usr/src/sbin/routed/input.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr/src/sbin/routed/input.c b/usr/src/sbin/routed/input.c index 058e6f7c61..a09aea98ce 100644 --- a/usr/src/sbin/routed/input.c +++ b/usr/src/sbin/routed/input.c @@ -1,5 +1,5 @@ #ifndef lint -static char sccsid[] = "@(#)input.c 4.7 (Berkeley) %G%"; +static char sccsid[] = "@(#)input.c 4.8 (Berkeley) %G%"; #endif /* @@ -118,10 +118,11 @@ rip_input(from, size) } /* - * Update if from gateway, shorter, or getting - * stale and equivalent. + * Update if from gateway and different, + * shorter, or getting stale and equivalent. */ - if (equal(from, &rt->rt_router) || + if ((equal(from, &rt->rt_router) && + n->rip_metric != rt->rt_metric ) || (unsigned) (n->rip_metric) < rt->rt_metric || (rt->rt_timer > (EXPIRE_TIME/2) && rt->rt_metric == n->rip_metric)) { -- 2.20.1