diff options
author | Zhang Xiao <xiao.zhang@windriver.com> | 2014-06-11 14:53:37 +0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2014-06-15 23:21:56 -0400 |
commit | d42a2e16056777615e6bcc126cdb92db3b4f9cdf (patch) | |
tree | f8b6d9ede1441e1935e39f44b4167237e657e576 /meta-networking/recipes-daemons | |
parent | f135f64596d45cbb5f6f722fd6ae4435137ef3a2 (diff) | |
download | meta-openembedded-d42a2e16056777615e6bcc126cdb92db3b4f9cdf.tar.gz |
tftp-hpa: bug fix on separated CR and LF
In ascii mode, if the CR and LF was separated into different transfer
blocks, This LF will be just dropped instead of replacing the previous
CR. Add a checking on the first character to fix it.
Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-daemons')
-rw-r--r-- | meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch | 38 | ||||
-rw-r--r-- | meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb | 1 |
2 files changed, 39 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch new file mode 100644 index 000000000..3e220ec38 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 6ed1eb8829dee351b54e183bc42c007cb306aaa5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Zhang Xiao <xiao.zhang@windriver.com> | ||
3 | Date: Wed, 11 Jun 2014 14:01:16 +0800 | ||
4 | Subject: [PATCH] tftp-hpa: bug fix on separated CR and LF | ||
5 | |||
6 | In ascii mode, if the CR and LF was separated into different transfer | ||
7 | blocks, LF will be just dropped instead of replacing the previous CR. | ||
8 | Add a checking on the first character to fix it. | ||
9 | |||
10 | Upstream-Status: pending | ||
11 | |||
12 | Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com> | ||
13 | --- | ||
14 | common/tftpsubs.c | 8 ++++++++ | ||
15 | 1 file changed, 8 insertions(+) | ||
16 | |||
17 | diff --git a/common/tftpsubs.c b/common/tftpsubs.c | ||
18 | index b4d4ffe..b4ea3f2 100644 | ||
19 | --- a/common/tftpsubs.c | ||
20 | +++ b/common/tftpsubs.c | ||
21 | @@ -207,6 +207,14 @@ int write_behind(FILE * file, int convert) | ||
22 | p = buf; | ||
23 | ct = count; | ||
24 | count = 0; | ||
25 | + | ||
26 | + /* Check the first character together with prevchar */ | ||
27 | + c = *p; | ||
28 | + if ((prevchar == '\r') && (c == '\n')) { | ||
29 | + lseek(fileno(file), -1, SEEK_CUR); | ||
30 | + count++; | ||
31 | + } | ||
32 | + | ||
33 | while (ct--) { /* loop over the buffer */ | ||
34 | c = *p++; /* pick up a character */ | ||
35 | if (prevchar == '\r') { /* if prev char was cr */ | ||
36 | -- | ||
37 | 1.8.5.2.233.g932f7e4 | ||
38 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb index 5baa61b35..366a4e9d4 100644 --- a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb +++ b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb | |||
@@ -24,6 +24,7 @@ SRC_URI = "http://kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-${PV}.t | |||
24 | file://default \ | 24 | file://default \ |
25 | file://init \ | 25 | file://init \ |
26 | file://add-error-check-for-disk-filled-up.patch \ | 26 | file://add-error-check-for-disk-filled-up.patch \ |
27 | file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \ | ||
27 | " | 28 | " |
28 | 29 | ||
29 | SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" | 30 | SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" |