svn commit: r238242 - stable/9/sys/netinet6

Bjoern A. Zeeb bz at FreeBSD.org
Sun Jul 8 12:34:12 UTC 2012


Author: bz
Date: Sun Jul  8 12:34:12 2012
New Revision: 238242
URL: http://svn.freebsd.org/changeset/base/238242

Log:
  MFC r235953:
  
     No need to hold the (expensive) rt lock over (expensive) logging.
  
  Approved by:	re

Modified:
  stable/9/sys/netinet6/icmp6.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet6/icmp6.c
==============================================================================
--- stable/9/sys/netinet6/icmp6.c	Sun Jul  8 12:30:25 2012	(r238241)
+++ stable/9/sys/netinet6/icmp6.c	Sun Jul  8 12:34:12 2012	(r238242)
@@ -2418,23 +2418,23 @@ icmp6_redirect_input(struct mbuf *m, int
 	if (rt) {
 		if (rt->rt_gateway == NULL ||
 		    rt->rt_gateway->sa_family != AF_INET6) {
+			RTFREE_LOCKED(rt);
 			nd6log((LOG_ERR,
 			    "ICMP6 redirect rejected; no route "
 			    "with inet6 gateway found for redirect dst: %s\n",
 			    icmp6_redirect_diag(&src6, &reddst6, &redtgt6)));
-			RTFREE_LOCKED(rt);
 			goto bad;
 		}
 
 		gw6 = &(((struct sockaddr_in6 *)rt->rt_gateway)->sin6_addr);
 		if (bcmp(&src6, gw6, sizeof(struct in6_addr)) != 0) {
+			RTFREE_LOCKED(rt);
 			nd6log((LOG_ERR,
 			    "ICMP6 redirect rejected; "
 			    "not equal to gw-for-src=%s (must be same): "
 			    "%s\n",
 			    ip6_sprintf(ip6buf, gw6),
 			    icmp6_redirect_diag(&src6, &reddst6, &redtgt6)));
-			RTFREE_LOCKED(rt);
 			goto bad;
 		}
 	} else {


More information about the svn-src-stable-9 mailing list