diff options
author | Fillod Stephane <stephane.fillod@grassvalley.com> | 2010-06-11 19:26:43 +0200 |
---|---|---|
committer | Ben Warren <biggerbadderben@gmail.com> | 2010-06-20 22:11:32 -0700 |
commit | e397e59e861aa818cda12a23206dde06f7e9f660 (patch) | |
tree | 1f83906c89e013a19b274776394c64c1664cae09 /net | |
parent | 1f241263e088a71b8f33f87b03a37c5418d41e2e (diff) | |
download | bootable_bootloader_goldelico_gta04-e397e59e861aa818cda12a23206dde06f7e9f660.zip bootable_bootloader_goldelico_gta04-e397e59e861aa818cda12a23206dde06f7e9f660.tar.gz bootable_bootloader_goldelico_gta04-e397e59e861aa818cda12a23206dde06f7e9f660.tar.bz2 |
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: Stephane Fillod <stephane.fillod@grassvalley.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/net.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } |