Date: Sat, 19 Mar 2011 19:50:36 +0000 (UTC) From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r219783 - head/sys/net Message-ID: <201103191950.p2JJoajG033225@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dchagin Date: Sat Mar 19 19:50:36 2011 New Revision: 219783 URL: http://svn.freebsd.org/changeset/base/219783 Log: A bit rearranged rtalloc1_fib() code. Initialize a variable when it is really needed. To avoid code duplication move the miss label to line up and jump on it. MFC after: 1 Week Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Mar 19 19:39:05 2011 (r219782) +++ head/sys/net/route.c Sat Mar 19 19:50:36 2011 (r219783) @@ -348,14 +348,13 @@ rtalloc1_fib(struct sockaddr *dst, int r if (dst->sa_family != AF_INET) /* Only INET supports > 1 fib now */ 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; - } + newrt = NULL; 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?201103191950.p2JJoajG033225>