Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jun 2011 05:23:28 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r222888 - stable/8/sys/net
Message-ID:  <201106090523.p595NSH4062995@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Thu Jun  9 05:23:28 2011
New Revision: 222888
URL: http://svn.freebsd.org/changeset/base/222888

Log:
  MFC r219783, r219786:
  
  A bit rearranged rtalloc1_fib() code.
  To avoid code duplication move the miss label to line up and jump on it.

Modified:
  stable/8/sys/net/route.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/net/route.c
==============================================================================
--- stable/8/sys/net/route.c	Thu Jun  9 05:21:08 2011	(r222887)
+++ stable/8/sys/net/route.c	Thu Jun  9 05:23:28 2011	(r222888)
@@ -349,13 +349,12 @@ rtalloc1_fib(struct sockaddr *dst, int r
 		fibnum = 0;
 	rnh = rt_tables_get_rnh(fibnum, dst->sa_family);
 	newrt = NULL;
+	if (rnh == NULL)
+		goto miss;
+
 	/*
 	 * Look up the address in the table for that Address Family
 	 */
-	if (rnh == NULL) {
-		V_rtstat.rts_unreach++;
-		goto miss;
-	}
 	needlock = !(ignflags & RTF_RNH_LOCKED);
 	if (needlock)
 		RADIX_NODE_HEAD_RLOCK(rnh);
@@ -380,8 +379,9 @@ rtalloc1_fib(struct sockaddr *dst, int r
 	 * Which basically means
 	 * "caint get there frm here"
 	 */
-	V_rtstat.rts_unreach++;
 miss:
+	V_rtstat.rts_unreach++;
+
 	if (report) {
 		/*
 		 * If required, report the failure to the supervising



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