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.
This commit is contained in:
parent
bf049ebdb1
commit
1db9f19b62
1 changed files with 2 additions and 2 deletions
|
@ -405,7 +405,7 @@ ipiput4(Fs *f, Ipifc *ifc, Block *bp)
|
||||||
if(r->ifc == nil) panic("nil route rfc");
|
if(r->ifc == nil) panic("nil route rfc");
|
||||||
if(r->ifc->reassemble){
|
if(r->ifc->reassemble){
|
||||||
frag = nhgets(h->frag);
|
frag = nhgets(h->frag);
|
||||||
if(frag) {
|
if(frag & ~IP_DF) {
|
||||||
h->tos = 0;
|
h->tos = 0;
|
||||||
if(frag & IP_MF)
|
if(frag & IP_MF)
|
||||||
h->tos = 1;
|
h->tos = 1;
|
||||||
|
@ -424,7 +424,7 @@ if(r->ifc == nil) panic("nil route rfc");
|
||||||
}
|
}
|
||||||
|
|
||||||
frag = nhgets(h->frag);
|
frag = nhgets(h->frag);
|
||||||
if(frag) {
|
if(frag & ~IP_DF) {
|
||||||
h->tos = 0;
|
h->tos = 0;
|
||||||
if(frag & IP_MF)
|
if(frag & IP_MF)
|
||||||
h->tos = 1;
|
h->tos = 1;
|
||||||
|
|
Loading…
Reference in a new issue