Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170976157
D57342.id179416.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
D57342.id179416.diff
View Options
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -421,24 +421,9 @@
goto out; /* m have already been freed */
}
- /* adjust pointer */
m = *mp;
ip6 = mtod(m, struct ip6_hdr *);
- /*
- * If the payload length field is 0 and the next header field indicates
- * Hop-by-Hop Options header, then a Jumbo Payload option MUST be
- * included. We no not support Jumbo Payloads so report an error.
- */
- if (ip6->ip6_plen == 0) {
- IP6STAT_INC(ip6s_badoptions);
- in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard);
- in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr);
- icmp6_error(m, ICMP6_PARAM_PROB,
- ICMP6_PARAMPROB_HEADER,
- (caddr_t)&ip6->ip6_plen - (caddr_t)ip6);
- goto out;
- }
/* ip6_hopopts_input() ensures that mbuf is contiguous */
hbh = (struct ip6_hbh *)(ip6 + 1);
*nxt = hbh->ip6h_nxt;
@@ -760,8 +745,11 @@
* We don't support Jumbograms, reject packets with plen == 0 as early
* as we can.
*/
- if (plen == 0)
+ if (__predict_false(plen == 0)) {
+ IP6STAT_INC(ip6s_tooshort);
+ in6_ifstat_inc(rcvif, ifs6_in_hdrerr);
goto bad;
+ }
/*
* Disambiguate address scope zones (if there is ambiguity).
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 8, 11:28 PM (6 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33698260
Default Alt Text
D57342.id179416.diff (1 KB)
Attached To
Mode
D57342: ip6: Drop dead code in ip6_input_hbh()
Attached
Detach File
Event Timeline
Log In to Comment