summaryrefslogtreecommitdiff
path: root/sys/src/9/ip/ip.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-12-21 17:25:55 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-12-21 17:25:55 +0100
commit1db9f19b62fbf52e4b33047b536cfb0fbfdd22cb (patch)
tree4c037ae7043d3a4c56c14ffe0516242bfcfc1d06 /sys/src/9/ip/ip.c
parentbf049ebdb1ede563304c9255d49d47df0098a531 (diff)
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.
Diffstat (limited to 'sys/src/9/ip/ip.c')
-rw-r--r--sys/src/9/ip/ip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/9/ip/ip.c b/sys/src/9/ip/ip.c
index 40fc9380e..0a8863e77 100644
--- a/sys/src/9/ip/ip.c
+++ b/sys/src/9/ip/ip.c
@@ -405,7 +405,7 @@ ipiput4(Fs *f, Ipifc *ifc, Block *bp)
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 @@ if(r->ifc == nil) panic("nil route rfc");
}
frag = nhgets(h->frag);
- if(frag) {
+ if(frag & ~IP_DF) {
h->tos = 0;
if(frag & IP_MF)
h->tos = 1;