Page MenuHomeFreeBSD

D36584.diff
No OneTemporary

D36584.diff

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

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)

Event Timeline