From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Fischer To: development@lists.ipfire.org Subject: [PATCH] dnsmasq 2.76test12 with patch 001 Date: Sun, 13 Mar 2016 18:03:34 +0100 Message-ID: <1457888614-1588-1-git-send-email-matthias.fischer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3007797616107246921==" List-Id: --===============3007797616107246921== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This is 2.76test12 with patch 001 (Account for TFTP packet headers in IPv6 co= rrectly). For details see: http://thekelleys.org.uk/gitweb/?p=3Ddnsmasq.git;a=3Dsummary Signed-off-by: Matthias Fischer --- 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_i= n_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.pat= ch 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 @@ =20 include Config =20 -VER =3D 2.76test11 +VER =3D 2.76test12 =20 THISAPP =3D dnsmasq-$(VER) DL_FILE =3D $(THISAPP).tar.xz @@ -43,7 +43,7 @@ objects =3D $(DL_FILE) =20 $(DL_FILE) =3D $(DL_FROM)/$(DL_FILE) =20 -$(DL_FILE)_MD5 =3D bded72ec7c28d9993c3ad7812b72d4f7 +$(DL_FILE)_MD5 =3D fca2833be4858f86955da324bf319753 =20 install : $(TARGET) =20 @@ -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_ret= urn_code_from_open.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/003-format_fi= x.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/004-Fix_point= er_declaration_botch.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/005-Tidy_pars= ing_code.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/006-Fix_broke= n_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_f= or_TFTP_packet_headers_in_IPv6_correctly.patch cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-Add-support-t= o-read-ISC-DHCP-lease-file.patch =20 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_correct= ly.patch @@ -0,0 +1,35 @@ +From d1377fa3c4f6093611dee8d610f6953eb8145d21 Mon Sep 17 00:00:00 2001 +From: Simon Kelley +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 =3D next(&p, end)) && !option_bool(OPT_TFTP_NOBLOCK)) + { ++ /* 32 bytes for IP, UDP and TFTP headers, 52 bytes for IPv6 */ ++ int overhead =3D (listen->family =3D=3D AF_INET) ? 32 : 52; + transfer->blocksize =3D atoi(opt); + if (transfer->blocksize < 1) + transfer->blocksize =3D 1; + if (transfer->blocksize > (unsigned)daemon->packet_buff_sz - 4) + transfer->blocksize =3D (unsigned)daemon->packet_buff_sz - 4; +- /* 32 bytes for IP, UDP and TFTP headers */ +- if (mtu !=3D 0 && transfer->blocksize > (unsigned)mtu - 32) +- transfer->blocksize =3D (unsigned)mtu - 32; ++ if (mtu !=3D 0 && transfer->blocksize > (unsigned)mtu - overhead) ++ transfer->blocksize =3D (unsigned)mtu - overhead; + transfer->opt_blocksize =3D 1; + transfer->block =3D 0; + } +--=20 +1.7.10.4 + diff --git a/src/patches/dnsmasq/001-Fix_typo_in_last_commit.patch b/src/patc= hes/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 -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 =3D 0; -- islast =3D 0; -+ is_last =3D 0; - break; - } - =20 ---=20 -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=3Ddnsmasq.git;a=3Dblobdiff_pla= in;f=3Dsrc%2Fdnsmasq.c;h=3D045ec53b8dd4e4a54a29370501741d3cc52b284d;hp=3D96aa= 7802aecd8b28db6e4d92d69d57384cd6b432;hb=3Df7cf7499435a5fa8c2835abdd70ca816074= 175a4;hpb=3Daa300f7167578bb1669e88ea69ef1f438cafe497 - -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) - { =20 - /* open stdout etc to /dev/null */ - int nullfd =3D open("/dev/null", O_RDWR); -- dup2(nullfd, STDOUT_FILENO); -- dup2(nullfd, STDERR_FILENO); -- dup2(nullfd, STDIN_FILENO); -- close(nullfd); -+ if (nullfd !=3D -1) -+ { -+ dup2(nullfd, STDOUT_FILENO); -+ dup2(nullfd, STDERR_FILENO); -+ dup2(nullfd, STDIN_FILENO); -+ close(nullfd); -+ } - } - =20 - /* if we are to run scripts, we need to fork a helper before dropping ro= ot. */ diff --git a/src/patches/dnsmasq/003-format_fix.patch b/src/patches/dnsmasq/0= 03-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 -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 - } -=20 - if (len =3D=3D -1) -- - ret_err(_("bad hex constant")); - else if ((new->clid =3D opt_malloc(len))) - { ---=20 -1.7.10.4 - diff --git a/src/patches/dnsmasq/004-Fix_pointer_declaration_botch.patch b/sr= c/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 -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) -=20 - new +=3D 5; - =20 -- if (!(p =3D whine_malloc(new * sizeof(unsigned char **)))) -+ if (!(p =3D whine_malloc(new * sizeof(unsigned char *)))) - return 0; =20 - =20 - if (old !=3D 0 && *wkspc) - { -- memcpy(p, *wkspc, old * sizeof(unsigned char **)); -+ memcpy(p, *wkspc, old * sizeof(unsigned char *)); - free(*wkspc); - } - =20 ---=20 -1.7.10.4 - diff --git a/src/patches/dnsmasq/005-Tidy_parsing_code.patch b/src/patches/dn= smasq/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 -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 *errst= r, char *gen_err, int comma - comma =3D split(arg);=20 - daemon->soa_retry =3D (u32)atoi(arg); - if (comma) -- { -- arg =3D comma; -- comma =3D split(arg);=20 -- daemon->soa_expiry =3D (u32)atoi(arg); -- } -+ daemon->soa_expiry =3D (u32)atoi(comma); - } - } - } -@@ -3907,13 +3903,8 @@ static int one_opt(int option, char *arg, char *errst= r, char *gen_err, int comma - if (!atoi_check16(arg, &priority)) - ret_err(_("invalid priority")); - =09 -- if (comma) -- { -- arg =3D comma; -- comma =3D split(arg); -- if (!atoi_check16(arg, &weight)) -- ret_err(_("invalid weight")); -- } -+ if (comma && !atoi_check16(comma, &weight)) -+ ret_err(_("invalid weight")); - } - } - } ---=20 -1.7.10.4 - diff --git a/src/patches/dnsmasq/006-Fix_broken_DNSMASQ_USER_x_envvars_in_scr= ipt_with_more_than_one_class.patch b/src/patches/dnsmasq/006-Fix_broken_DNSMA= SQ_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_wit= h_more_than_one_class.patch +++ /dev/null @@ -1,62 +0,0 @@ -From a93bd4b0160e2e201e54021a79ea71e135fbe41b Mon Sep 17 00:00:00 2001 -From: Simon Kelley -Date: Tue, 1 Mar 2016 18:58:01 +0000 -Subject: [PATCH] Fix broken DNSMASQ_USER 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) - } -=20 - #ifdef HAVE_SCRIPT -+/* delim =3D=3D -1 -> delim =3D 0, but embeded 0s, creating extra records, = are OK. */ - void lease_add_extradata(struct dhcp_lease *lease, unsigned char *data, uns= igned int len, int delim) - { - unsigned int i; - =20 -- /* check for embeded NULLs */ -- for (i =3D 0; i < len; i++) -- if (data[i] =3D=3D 0) -- { -- len =3D i; -- break; -- } -- -+ if (delim =3D=3D -1) -+ delim =3D 0; -+ else -+ /* check for embeded NULLs */ -+ for (i =3D 0; i < len; i++) -+ if (data[i] =3D=3D 0) -+ { -+ len =3D i; -+ break; -+ } -+ =20 - if ((lease->extradata_size - lease->extradata_len) < (len + 1)) - { - size_t newsz =3D 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 b= yte will be zero. */ - if (len !=3D 0 && ucp[0] =3D=3D 0) - ucp++, len--; -- lease_add_extradata(lease, ucp, len, 0); -+ lease_add_extradata(lease, ucp, len, -1); - } - } - #endif ---=20 -1.7.10.4 - --=20 2.7.3 --===============3007797616107246921==--