ref: 1f3e6aa847212ef9c47679714fce685e47dd84be
parent: c0cdd4e0f936200bfc7b2c2f1aa1e0671b2fb341
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Dec 21 12:25:55 EST 2014
ip: exclude "don't fragment" bit from ipv4 reassembly test other operating systems always set the "don't fragment" bit in ther outgoing ipv4 packets causing us to unnecesarily call ip4reassemble() looking for a fragment reassembly queue. the change excludes the "don't fragment" bit from the test so we now call ip4reassemble() only when the "more fragmens" bit is set or a fragment offset other than zero is given. this optimization was discovered from akaros.
--- a/sys/src/9/ip/ip.c
+++ b/sys/src/9/ip/ip.c
@@ -405,7 +405,7 @@
if(r->ifc == nil) panic("nil route rfc"); if(r->ifc->reassemble){frag = nhgets(h->frag);
- if(frag) {+ if(frag & ~IP_DF) {h->tos = 0;
if(frag & IP_MF)
h->tos = 1;
@@ -424,7 +424,7 @@
}
frag = nhgets(h->frag);
- if(frag) {+ if(frag & ~IP_DF) {h->tos = 0;
if(frag & IP_MF)
h->tos = 1;
--
⑨