diff options
author | Andrew Gallatin <gallatin@FreeBSD.org> | 2020-05-12 14:01:12 +0000 |
---|---|---|
committer | Andrew Gallatin <gallatin@FreeBSD.org> | 2020-05-12 14:01:12 +0000 |
commit | d7452d89ad48587b91d20ed6a9480f832c491502 (patch) | |
tree | 02f9be350ac51d876bfa1ec990977e58d9dcd983 | |
parent | b9cc3262bc4eca6e23c0719990faa78e3154c6a5 (diff) |
Notes
-rw-r--r-- | sys/netinet6/ip6_output.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index de3c211a11f5..f69b9c75c807 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -322,7 +322,8 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int hlen, u_char nextproto, static int ip6_output_send(struct inpcb *inp, struct ifnet *ifp, struct ifnet *origifp, - struct mbuf *m, struct sockaddr_in6 *dst, struct route_in6 *ro) + struct mbuf *m, struct sockaddr_in6 *dst, struct route_in6 *ro, + bool stamp_tag) { #ifdef KERN_TLS struct ktls_session *tls = NULL; @@ -353,6 +354,10 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, struct ifnet *origifp, error = EAGAIN; goto done; } + /* + * Always stamp tags that include NIC ktls. + */ + stamp_tag = true; } #endif #ifdef RATELIMIT @@ -366,7 +371,7 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, struct ifnet *origifp, mst = inp->inp_snd_tag; } #endif - if (mst != NULL) { + if (stamp_tag && mst != NULL) { KASSERT(m->m_pkthdr.rcvif == NULL, ("trying to add a send tag to a forwarded packet")); if (mst->ifp != ifp) { @@ -1165,7 +1170,8 @@ passout: m->m_pkthdr.len); ifa_free(&ia6->ia_ifa); } - error = ip6_output_send(inp, ifp, origifp, m, dst, ro); + error = ip6_output_send(inp, ifp, origifp, m, dst, ro, + (flags & IP_NO_SND_TAG_RL) ? false : true); goto done; } @@ -1256,7 +1262,8 @@ sendorfree: counter_u64_add(ia->ia_ifa.ifa_obytes, m->m_pkthdr.len); } - error = ip6_output_send(inp, ifp, origifp, m, dst, ro); + error = ip6_output_send(inp, ifp, origifp, m, dst, ro, + true); } else m_freem(m); } |