diff options
author | dchagin <dchagin@FreeBSD.org> | 2011-03-19 19:50:36 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2011-03-19 19:50:36 +0000 |
commit | b3fb44555374e44743991fa506daf14d46cd1b7d (patch) | |
tree | 63dca60a64959690528f23749d44b0ee598d5292 | |
parent | 10a97db83b06141e1745cbef7bbeb6d8a301088e (diff) | |
download | FreeBSD-src-b3fb44555374e44743991fa506daf14d46cd1b7d.zip FreeBSD-src-b3fb44555374e44743991fa506daf14d46cd1b7d.tar.gz |
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
-rw-r--r-- | sys/net/route.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index 2c83fef..15f1834 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -348,14 +348,13 @@ rtalloc1_fib(struct sockaddr *dst, int report, u_long ignflags, 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 report, u_long ignflags, * 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 |