Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 May 2020 15:32:36 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r361137 - head/sys/netinet
Message-ID:  <202005171532.04HFWaDY089588@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: melifaro
Date: Sun May 17 15:32:36 2020
New Revision: 361137
URL: https://svnweb.freebsd.org/changeset/base/361137

Log:
  Remove redundant checks for nhop validity.
   Currently NH_IS_VALID() simly aliases to RT_LINK_IS_UP(), so we're
   checking the same thing twice.
  
  In the near future the implementation of this check will be simpler,
   as there are plans to introduce control-plane interface status monitoring
   similar to ipfw interface tracker.

Modified:
  head/sys/netinet/ip_output.c

Modified: head/sys/netinet/ip_output.c
==============================================================================
--- head/sys/netinet/ip_output.c	Sun May 17 14:52:54 2020	(r361136)
+++ head/sys/netinet/ip_output.c	Sun May 17 15:32:36 2020	(r361137)
@@ -407,8 +407,7 @@ again:
 	 * Also check whether routing cache needs invalidation.
 	 */
 	if (ro != NULL && ro->ro_nh != NULL &&
-	    ((!NH_IS_VALID(ro->ro_nh)) || !RT_LINK_IS_UP(ro->ro_nh->nh_ifp) ||
-	    dst->sin_family != AF_INET ||
+	    ((!NH_IS_VALID(ro->ro_nh)) || dst->sin_family != AF_INET ||
 	    dst->sin_addr.s_addr != ip->ip_dst.s_addr))
 		RO_INVALIDATE_CACHE(ro);
 	ia = NULL;
@@ -480,8 +479,7 @@ again:
 			ro->ro_nh = fib4_lookup(fibnum, dst->sin_addr, 0,
 			    NHR_REF, flowid);
 
-			if (ro->ro_nh == NULL || (!NH_IS_VALID(ro->ro_nh)) ||
-			    !RT_LINK_IS_UP(ro->ro_nh->nh_ifp)) {
+			if (ro->ro_nh == NULL || (!NH_IS_VALID(ro->ro_nh))) {
 #if defined(IPSEC) || defined(IPSEC_SUPPORT)
 				/*
 				 * There is no route for this packet, but it is



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005171532.04HFWaDY089588>