Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Oct 2019 17:02:28 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r353356 - head/sys/netinet6
Message-ID:  <201910091702.x99H2SwW091963@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Oct  9 17:02:28 2019
New Revision: 353356
URL: https://svnweb.freebsd.org/changeset/base/353356

Log:
  ip6_output() has a complex set of gotos, and some can jump out of
  the epoch section towards return statement. Since entering epoch
  is cheap, it is easier to cover the whole function with epoch,
  rather than try to properly maintain its state.

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==============================================================================
--- head/sys/netinet6/ip6_output.c	Wed Oct  9 16:59:42 2019	(r353355)
+++ head/sys/netinet6/ip6_output.c	Wed Oct  9 17:02:28 2019	(r353356)
@@ -405,6 +405,8 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
 	struct m_tag *fwd_tag = NULL;
 	uint32_t id;
 
+	NET_EPOCH_ENTER(et);
+
 	if (inp != NULL) {
 		INP_LOCK_ASSERT(inp);
 		M_SETFIB(m, inp->inp_inc.inc_fibnum);
@@ -587,7 +589,6 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
 		ro = &opt->ip6po_route;
 	dst = (struct sockaddr_in6 *)&ro->ro_dst;
 	fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m);
-	NET_EPOCH_ENTER(et);
 again:
 	/*
 	 * if specified, try to fill in the traffic class field.



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