Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102725261
D36584.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
683 B
Referenced Files
None
Subscribers
None
D36584.diff
View Options
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -868,16 +868,14 @@
ip_len = ntohs(ip->ip_len);
ip_off = ntohs(ip->ip_off);
- if (ip_off & IP_DF) { /* Fragmentation not allowed */
- IPSTAT_INC(ips_cantfrag);
- return EMSGSIZE;
- }
-
/*
- * Must be able to put at least 8 bytes per fragment.
+ * Packet shall not have "Don't Fragment" flag and have at least 8
+ * bytes of payload.
*/
- if (len < 8)
- return EMSGSIZE;
+ if (__predict_false((ip_off & IP_DF) || len < 8)) {
+ IPSTAT_INC(ips_cantfrag);
+ return (EMSGSIZE);
+ }
/*
* If the interface will not calculate checksums on
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 9:56 AM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14674365
Default Alt Text
D36584.diff (683 B)
Attached To
Mode
D36584: ip_output: always increase "cantfrag" stat if ip_fragment() fails
Attached
Detach File
Event Timeline
Log In to Comment