提交 e397e59e 编写于 作者: F Fillod Stephane 提交者: Ben Warren

ip/defrag: fix processing of last short fragment

TFTP'ing a file of size 1747851 bytes with CONFIG_IP_DEFRAG and
CONFIG_TFTP_BLOCKSIZE set to 4096 fails with a timeout, because
the last fragment is not taken into account. This patch fixes
IP fragments having less than 8 bytes of payload.
Signed-off-by: NStephane Fillod <stephane.fillod@grassvalley.com>
Acked-by: NAlessandro Rubini <rubini@gnudd.com>
Signed-off-by: NBen Warren <biggerbadderben@gmail.com>
上级 1f241263
......@@ -1201,7 +1201,8 @@ static IP_t *__NetDefragment(IP_t *ip, int *lenp)
h = payload + h->next_hole;
}
if (offset8 + (len / 8) <= h - payload) {
/* last fragment may be 1..7 bytes, the "+7" forces acceptance */
if (offset8 + ((len + 7) / 8) <= h - payload) {
/* no overlap with holes (dup fragment?) */
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册