ip/tcp: never raise the mss over the link mtu < 1280 for v6
v6 mandates minimum mtu of 1280, tho someone *could* setup an interface with a lower mtu or set it lower for testing.
This commit is contained in:
parent
323d625864
commit
78d2a52577
1 changed files with 5 additions and 4 deletions
|
@ -864,13 +864,14 @@ tcpmtu(Route *r, int version, uint *scale)
|
||||||
* otherwise, we use the default MSS which assumes a
|
* otherwise, we use the default MSS which assumes a
|
||||||
* safe minimum MTU of 1280 bytes for V6.
|
* safe minimum MTU of 1280 bytes for V6.
|
||||||
*/
|
*/
|
||||||
if(r != nil && (version == V4 || (r->type & (Rifc|Runi)) != 0)){
|
if(r != nil){
|
||||||
ifc = r->ifc;
|
ifc = r->ifc;
|
||||||
mtu = ifc->maxtu - ifc->m->hsize;
|
mtu = ifc->maxtu - ifc->m->hsize;
|
||||||
if(version == V6)
|
if(version == V4)
|
||||||
return mtu - (TCP6_PKT + TCP6_HDRSIZE);
|
|
||||||
else
|
|
||||||
return mtu - (TCP4_PKT + TCP4_HDRSIZE);
|
return mtu - (TCP4_PKT + TCP4_HDRSIZE);
|
||||||
|
mtu -= TCP6_PKT + TCP6_HDRSIZE;
|
||||||
|
if((r->type & (Rifc|Runi)) != 0 || mtu <= DEF_MSS6)
|
||||||
|
return mtu;
|
||||||
}
|
}
|
||||||
if(version == V6)
|
if(version == V6)
|
||||||
return DEF_MSS6;
|
return DEF_MSS6;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue