|
@ -669,12 +669,18 @@ void tcp_rewrite_wscale(struct tcphdr *tcp, uint8_t scale_factor) |
|
|
if (scale && scale[1]==3) // length should be 3
|
|
|
if (scale && scale[1]==3) // length should be 3
|
|
|
{ |
|
|
{ |
|
|
scale_factor_old=scale[2]; |
|
|
scale_factor_old=scale[2]; |
|
|
|
|
|
// do not allow increasing scale factor
|
|
|
|
|
|
if (scale_factor>=scale_factor_old) |
|
|
|
|
|
DLOG("Scale factor %u unchanged\n", scale_factor_old) |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
scale[2]=scale_factor; |
|
|
scale[2]=scale_factor; |
|
|
if (scale_factor_old!=scale_factor) |
|
|
if (scale_factor_old!=scale_factor) |
|
|
DLOG("Scale factor change %u => %u\n", scale_factor_old, scale_factor) |
|
|
DLOG("Scale factor change %u => %u\n", scale_factor_old, scale_factor) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
// scale_factor=-1 - do not change
|
|
|
// scale_factor=-1 - do not change
|
|
|
void tcp_rewrite_winsize(struct tcphdr *tcp, uint16_t winsize, uint8_t scale_factor) |
|
|
void tcp_rewrite_winsize(struct tcphdr *tcp, uint16_t winsize, uint8_t scale_factor) |
|
|
{ |
|
|
{ |
|
|