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.
This commit is contained in:
glebius 2019-10-09 17:02:28 +00:00
parent 9618aadcd8
commit 62fd3c33fa

View File

@ -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.