mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
In case of IPsec he have to do delayed checksum calculations before
adding any extension header, or rather before calling into IPsec processing as we may send the packet and not return to IPv6 output processing here. PR: kern/170116 MFC After: 3 days
This commit is contained in:
parent
adebcba798
commit
3b43b78342
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238960
@ -306,6 +306,20 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
|
||||
goto freehdrs;
|
||||
case -1: /* Do IPSec */
|
||||
needipsec = 1;
|
||||
/*
|
||||
* Do delayed checksums now, as we may send before returning.
|
||||
*/
|
||||
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) {
|
||||
plen = m->m_pkthdr.len - sizeof(*ip6);
|
||||
in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr));
|
||||
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6;
|
||||
}
|
||||
#ifdef SCTP
|
||||
if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) {
|
||||
sctp_delayed_cksum(m, sizeof(struct ip6_hdr));
|
||||
m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6;
|
||||
}
|
||||
#endif
|
||||
case 0: /* No IPSec */
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user