svn commit: r351419 - stable/12/sys/netinet
Andrey V. Elsukov
ae at FreeBSD.org
Fri Aug 23 10:11:11 UTC 2019
Author: ae
Date: Fri Aug 23 10:11:10 2019
New Revision: 351419
URL: https://svnweb.freebsd.org/changeset/base/351419
Log:
MFC r350974:
Since ipvoly is used for checksum calculation, part of original IP
header is zeroed. This part includes ip_ttl field, that can be used
later in IP_MINTTL socket option handling.
PR: 239799
Modified:
stable/12/sys/netinet/tcp_input.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/netinet/tcp_input.c
==============================================================================
--- stable/12/sys/netinet/tcp_input.c Fri Aug 23 07:24:36 2019 (r351418)
+++ stable/12/sys/netinet/tcp_input.c Fri Aug 23 10:11:10 2019 (r351419)
@@ -576,6 +576,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto)
int optlen = 0;
#ifdef INET
int len;
+ uint8_t ipttl;
#endif
int tlen = 0, off;
int drop_hdrlen;
@@ -698,6 +699,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto)
* Checksum extended TCP header and data.
*/
len = off0 + tlen;
+ ipttl = ip->ip_ttl;
bzero(ipov->ih_x1, sizeof(ipov->ih_x1));
ipov->ih_len = htons(tlen);
th->th_sum = in_cksum(m, len);
@@ -706,6 +708,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto)
/* Reset TOS bits */
ip->ip_tos = iptos;
/* Re-initialization for later version check */
+ ip->ip_ttl = ipttl;
ip->ip_v = IPVERSION;
ip->ip_hl = off0 >> 2;
}
More information about the svn-src-stable-12
mailing list