Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151071104
D8053.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8053.id.diff
View Options
Index: head/sys/netinet/tcp_input.c
===================================================================
--- head/sys/netinet/tcp_input.c
+++ head/sys/netinet/tcp_input.c
@@ -603,7 +603,7 @@
#ifdef TCP_SIGNATURE
uint8_t sig_checked = 0;
#endif
- uint8_t iptos = 0;
+ uint8_t iptos;
struct m_tag *fwd_tag = NULL;
#ifdef INET6
struct ip6_hdr *ip6 = NULL;
@@ -675,6 +675,7 @@
/* XXX stat */
goto drop;
}
+ iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
}
#endif
#if defined(INET) && defined(INET6)
@@ -701,6 +702,7 @@
th = (struct tcphdr *)((caddr_t)ip + off0);
tlen = ntohs(ip->ip_len) - off0;
+ iptos = ip->ip_tos;
if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) {
if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR)
th->th_sum = m->m_pkthdr.csum_data;
@@ -721,29 +723,20 @@
ipov->ih_len = htons(tlen);
th->th_sum = in_cksum(m, len);
/* Reset length for SDT probes. */
- ip->ip_len = htons(tlen + off0);
+ ip->ip_len = htons(len);
+ /* Reset TOS bits */
+ ip->ip_tos = iptos;
+ /* Re-initialization for later version check */
+ ip->ip_v = IPVERSION;
}
if (th->th_sum) {
TCPSTAT_INC(tcps_rcvbadsum);
goto drop;
}
- /* Re-initialization for later version check */
- ip->ip_v = IPVERSION;
}
#endif /* INET */
-#ifdef INET6
- if (isipv6)
- iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
-#endif
-#if defined(INET) && defined(INET6)
- else
-#endif
-#ifdef INET
- iptos = ip->ip_tos;
-#endif
-
/*
* Check that TCP offset makes sense,
* pull out TCP options and adjust length. XXX
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 6, 7:09 PM (18 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30994134
Default Alt Text
D8053.id.diff (1 KB)
Attached To
Mode
D8053: Properly preserve ip_tos bits for IPv4 packets
Attached
Detach File
Event Timeline
Log In to Comment