This is 2.76test12 with patch 001 (Account for TFTP packet headers in IPv6 correctly).
For details see: http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=summary
Signed-off-by: Matthias Fischer matthias.fischer@ipfire.org --- lfs/dnsmasq | 11 ++-- ...for_TFTP_packet_headers_in_IPv6_correctly.patch | 35 ++++++++++++ .../dnsmasq/001-Fix_typo_in_last_commit.patch | 25 --------- .../dnsmasq/002-Check_return_code_from_open.patch | 24 --------- src/patches/dnsmasq/003-format_fix.patch | 24 --------- .../004-Fix_pointer_declaration_botch.patch | 31 ----------- src/patches/dnsmasq/005-Tidy_parsing_code.patch | 45 ---------------- ...nvvars_in_script_with_more_than_one_class.patch | 62 ---------------------- 8 files changed, 38 insertions(+), 219 deletions(-) create mode 100644 src/patches/dnsmasq/001-Account_for_TFTP_packet_headers_in_IPv6_correctly.patch delete mode 100644 src/patches/dnsmasq/001-Fix_typo_in_last_commit.patch delete mode 100644 src/patches/dnsmasq/002-Check_return_code_from_open.patch delete mode 100644 src/patches/dnsmasq/003-format_fix.patch delete mode 100644 src/patches/dnsmasq/004-Fix_pointer_declaration_botch.patch delete mode 100644 src/patches/dnsmasq/005-Tidy_parsing_code.patch delete mode 100644 src/patches/dnsmasq/006-Fix_broken_DNSMASQ_USER_x_envvars_in_script_with_more_than_one_class.patch
diff --git a/lfs/dnsmasq b/lfs/dnsmasq index b69aae3..3622e4d 100644 --- a/lfs/dnsmasq +++ b/lfs/dnsmasq @@ -24,7 +24,7 @@
include Config
-VER = 2.76test11 +VER = 2.76test12
THISAPP = dnsmasq-$(VER) DL_FILE = $(THISAPP).tar.xz @@ -43,7 +43,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = bded72ec7c28d9993c3ad7812b72d4f7 +$(DL_FILE)_MD5 = fca2833be4858f86955da324bf319753
install : $(TARGET)
@@ -73,12 +73,7 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/001-Fix_typo_in_last_commit.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/002-Check_return_code_from_open.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/003-format_fix.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/004-Fix_pointer_declaration_botch.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/005-Tidy_parsing_code.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/006-Fix_broken_DNSMASQ_USER_x_envvars_in_script_with_more_than_one_class.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/001-Account_for_TFTP_packet_headers_in_IPv6_correctly.patch cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
cd $(DIR_APP) && sed -i src/config.h \ diff --git a/src/patches/dnsmasq/001-Account_for_TFTP_packet_headers_in_IPv6_correctly.patch b/src/patches/dnsmasq/001-Account_for_TFTP_packet_headers_in_IPv6_correctly.patch new file mode 100644 index 0000000..18d0105 --- /dev/null +++ b/src/patches/dnsmasq/001-Account_for_TFTP_packet_headers_in_IPv6_correctly.patch @@ -0,0 +1,35 @@ +From d1377fa3c4f6093611dee8d610f6953eb8145d21 Mon Sep 17 00:00:00 2001 +From: Simon Kelley simon@thekelleys.org.uk +Date: Fri, 4 Mar 2016 21:32:21 +0000 +Subject: [PATCH] Account for TFTP packet headers in IPv6 correctly. + +--- + src/tftp.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/tftp.c b/src/tftp.c +index dc4aa85..5e4a32a 100644 +--- a/src/tftp.c ++++ b/src/tftp.c +@@ -346,14 +346,15 @@ void tftp_request(struct listener *listen, time_t now) + { + if ((opt = next(&p, end)) && !option_bool(OPT_TFTP_NOBLOCK)) + { ++ /* 32 bytes for IP, UDP and TFTP headers, 52 bytes for IPv6 */ ++ int overhead = (listen->family == AF_INET) ? 32 : 52; + transfer->blocksize = atoi(opt); + if (transfer->blocksize < 1) + transfer->blocksize = 1; + if (transfer->blocksize > (unsigned)daemon->packet_buff_sz - 4) + transfer->blocksize = (unsigned)daemon->packet_buff_sz - 4; +- /* 32 bytes for IP, UDP and TFTP headers */ +- if (mtu != 0 && transfer->blocksize > (unsigned)mtu - 32) +- transfer->blocksize = (unsigned)mtu - 32; ++ if (mtu != 0 && transfer->blocksize > (unsigned)mtu - overhead) ++ transfer->blocksize = (unsigned)mtu - overhead; + transfer->opt_blocksize = 1; + transfer->block = 0; + } +-- +1.7.10.4 + diff --git a/src/patches/dnsmasq/001-Fix_typo_in_last_commit.patch b/src/patches/dnsmasq/001-Fix_typo_in_last_commit.patch deleted file mode 100644 index dae4d99..0000000 --- a/src/patches/dnsmasq/001-Fix_typo_in_last_commit.patch +++ /dev/null @@ -1,25 +0,0 @@ -From aa300f7167578bb1669e88ea69ef1f438cafe497 Mon Sep 17 00:00:00 2001 -From: Simon Kelley simon@thekelleys.org.uk -Date: Tue, 1 Mar 2016 15:19:13 +0000 -Subject: [PATCH] Fix typo in last commit. - ---- - src/edns0.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/edns0.c b/src/edns0.c -index a8d8cb6..9f66766 100644 ---- a/src/edns0.c -+++ b/src/edns0.c -@@ -145,7 +145,7 @@ size_t add_pseudoheader(struct dns_header *header, size_t plen, unsigned char *l - if (i + len > rdlen) - { - rdlen = 0; -- islast = 0; -+ is_last = 0; - break; - } - --- -1.7.10.4 - diff --git a/src/patches/dnsmasq/002-Check_return_code_from_open.patch b/src/patches/dnsmasq/002-Check_return_code_from_open.patch deleted file mode 100644 index 6a6b5b5..0000000 --- a/src/patches/dnsmasq/002-Check_return_code_from_open.patch +++ /dev/null @@ -1,24 +0,0 @@ -X-Git-Url: http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blobdiff_plain;f=src%2Fdnsm... - -diff --git a/src/dnsmasq.c b/src/dnsmasq.c -index 96aa780..045ec53 100644 ---- a/src/dnsmasq.c -+++ b/src/dnsmasq.c -@@ -561,10 +561,13 @@ int main (int argc, char **argv) - { - /* open stdout etc to /dev/null */ - int nullfd = open("/dev/null", O_RDWR); -- dup2(nullfd, STDOUT_FILENO); -- dup2(nullfd, STDERR_FILENO); -- dup2(nullfd, STDIN_FILENO); -- close(nullfd); -+ if (nullfd != -1) -+ { -+ dup2(nullfd, STDOUT_FILENO); -+ dup2(nullfd, STDERR_FILENO); -+ dup2(nullfd, STDIN_FILENO); -+ close(nullfd); -+ } - } - - /* if we are to run scripts, we need to fork a helper before dropping root. */ diff --git a/src/patches/dnsmasq/003-format_fix.patch b/src/patches/dnsmasq/003-format_fix.patch deleted file mode 100644 index 0e5b85d..0000000 --- a/src/patches/dnsmasq/003-format_fix.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 7aa3f9af665eeee0a825ecb6d6422c6885b81a20 Mon Sep 17 00:00:00 2001 -From: Simon Kelley simon@thekelleys.org.uk -Date: Tue, 1 Mar 2016 16:32:30 +0000 -Subject: [PATCH] format fix. - ---- - src/option.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/src/option.c b/src/option.c -index f7dc370..12c0468 100644 ---- a/src/option.c -+++ b/src/option.c -@@ -2966,7 +2966,6 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma - } - - if (len == -1) -- - ret_err(_("bad hex constant")); - else if ((new->clid = opt_malloc(len))) - { --- -1.7.10.4 - diff --git a/src/patches/dnsmasq/004-Fix_pointer_declaration_botch.patch b/src/patches/dnsmasq/004-Fix_pointer_declaration_botch.patch deleted file mode 100644 index c56312a..0000000 --- a/src/patches/dnsmasq/004-Fix_pointer_declaration_botch.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 4b6af5d53faa7ed8250eebaeb6b91f2e5ac58dc2 Mon Sep 17 00:00:00 2001 -From: Simon Kelley simon@thekelleys.org.uk -Date: Tue, 1 Mar 2016 17:00:26 +0000 -Subject: [PATCH] Fix pointer declaration botch. - ---- - src/rrfilter.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/rrfilter.c b/src/rrfilter.c -index 38afbee..e42d621 100644 ---- a/src/rrfilter.c -+++ b/src/rrfilter.c -@@ -323,12 +323,12 @@ int expand_workspace(unsigned char ***wkspc, int *szp, int new) - - new += 5; - -- if (!(p = whine_malloc(new * sizeof(unsigned char **)))) -+ if (!(p = whine_malloc(new * sizeof(unsigned char *)))) - return 0; - - if (old != 0 && *wkspc) - { -- memcpy(p, *wkspc, old * sizeof(unsigned char **)); -+ memcpy(p, *wkspc, old * sizeof(unsigned char *)); - free(*wkspc); - } - --- -1.7.10.4 - diff --git a/src/patches/dnsmasq/005-Tidy_parsing_code.patch b/src/patches/dnsmasq/005-Tidy_parsing_code.patch deleted file mode 100644 index 9e57aff..0000000 --- a/src/patches/dnsmasq/005-Tidy_parsing_code.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 407a1f3e95f617c1cd9ecab8fc7df09aca6e80af Mon Sep 17 00:00:00 2001 -From: Simon Kelley simon@thekelleys.org.uk -Date: Tue, 1 Mar 2016 17:06:07 +0000 -Subject: [PATCH] Tidy parsing code. - ---- - src/option.c | 15 +++------------ - 1 file changed, 3 insertions(+), 12 deletions(-) - -diff --git a/src/option.c b/src/option.c -index 12c0468..c1f8b5a 100644 ---- a/src/option.c -+++ b/src/option.c -@@ -1990,11 +1990,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma - comma = split(arg); - daemon->soa_retry = (u32)atoi(arg); - if (comma) -- { -- arg = comma; -- comma = split(arg); -- daemon->soa_expiry = (u32)atoi(arg); -- } -+ daemon->soa_expiry = (u32)atoi(comma); - } - } - } -@@ -3907,13 +3903,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma - if (!atoi_check16(arg, &priority)) - ret_err(_("invalid priority")); - -- if (comma) -- { -- arg = comma; -- comma = split(arg); -- if (!atoi_check16(arg, &weight)) -- ret_err(_("invalid weight")); -- } -+ if (comma && !atoi_check16(comma, &weight)) -+ ret_err(_("invalid weight")); - } - } - } --- -1.7.10.4 - diff --git a/src/patches/dnsmasq/006-Fix_broken_DNSMASQ_USER_x_envvars_in_script_with_more_than_one_class.patch b/src/patches/dnsmasq/006-Fix_broken_DNSMASQ_USER_x_envvars_in_script_with_more_than_one_class.patch deleted file mode 100644 index 9cdd131..0000000 --- a/src/patches/dnsmasq/006-Fix_broken_DNSMASQ_USER_x_envvars_in_script_with_more_than_one_class.patch +++ /dev/null @@ -1,62 +0,0 @@ -From a93bd4b0160e2e201e54021a79ea71e135fbe41b Mon Sep 17 00:00:00 2001 -From: Simon Kelley simon@thekelleys.org.uk -Date: Tue, 1 Mar 2016 18:58:01 +0000 -Subject: [PATCH] Fix broken DNSMASQ_USER<x> envvars in script with more than - one class. - ---- - src/lease.c | 20 ++++++++++++-------- - src/rfc2131.c | 2 +- - 2 files changed, 13 insertions(+), 9 deletions(-) - -diff --git a/src/lease.c b/src/lease.c -index a4c06c8..20cac90 100644 ---- a/src/lease.c -+++ b/src/lease.c -@@ -1110,18 +1110,22 @@ int do_script_run(time_t now) - } - - #ifdef HAVE_SCRIPT -+/* delim == -1 -> delim = 0, but embeded 0s, creating extra records, are OK. */ - void lease_add_extradata(struct dhcp_lease *lease, unsigned char *data, unsigned int len, int delim) - { - unsigned int i; - -- /* check for embeded NULLs */ -- for (i = 0; i < len; i++) -- if (data[i] == 0) -- { -- len = i; -- break; -- } -- -+ if (delim == -1) -+ delim = 0; -+ else -+ /* check for embeded NULLs */ -+ for (i = 0; i < len; i++) -+ if (data[i] == 0) -+ { -+ len = i; -+ break; -+ } -+ - if ((lease->extradata_size - lease->extradata_len) < (len + 1)) - { - size_t newsz = lease->extradata_len + len + 100; -diff --git a/src/rfc2131.c b/src/rfc2131.c -index e21efb5..f3c8895 100644 ---- a/src/rfc2131.c -+++ b/src/rfc2131.c -@@ -1308,7 +1308,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index, - /* If the user-class option started as counted strings, the first byte will be zero. */ - if (len != 0 && ucp[0] == 0) - ucp++, len--; -- lease_add_extradata(lease, ucp, len, 0); -+ lease_add_extradata(lease, ucp, len, -1); - } - } - #endif --- -1.7.10.4 -