From mboxrd@z Thu Jan 1 00:00:00 1970 From: git@ipfire.org To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 64835e022c52d24432d201bd4d57f1aa962c1f90 Date: Sun, 28 Feb 2016 21:11:59 +0000 Message-ID: <20160228211200.282AC1081BC7@git01.ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3873863556123599613==" List-Id: --===============3873863556123599613== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree". The branch, next has been updated via 64835e022c52d24432d201bd4d57f1aa962c1f90 (commit) via a6cd8b9b5d903da27fef106329c892e372753e5f (commit) via 3b9815eb87e83a1b24e85ce0eab14a962b62ccd0 (commit) from 43747fae333273890aadb66b72d911efaa4c2086 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 64835e022c52d24432d201bd4d57f1aa962c1f90 Author: Michael Tremer Date: Sun Feb 28 12:27:06 2016 -0800 udev: Fix calling VLAN script =20 The VLAN hotplugging script was called with a wrong parameter that should just be used to rename devices. Hence the script was not correctly executed and did not create the virtual devices. =20 Fixes: #11009 =20 Signed-off-by: Michael Tremer commit a6cd8b9b5d903da27fef106329c892e372753e5f Author: Matthias Fischer Date: Sat Feb 27 16:29:45 2016 +0100 dnsmasq: 2.76test10 with latest patch (005) and some fixes =20 1. Added patch 005 because of the discussion on the dnsmasq-list: "I've noticed that replies which get their TTL from the dhcp-ttl option always get the TTL specified in dhcp-ttl. I'd prefer something like max(0, min(, - )). Otherwise, dns might hand out a high TTL for a dhcp-lease which expires one second later. ... Seems a sensible addition. =20 Cheers, =20 Simon." =20 2. Fixed several line numbers and patch lines in 'dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch'. On the last build I got some "Hunk failed" messages. Patches are now applied exactly at the given lines. =20 3. Nevertheless, I still get some warnings: ... dnsmasq.c: In function 'main': dnsmasq.c:55:7: warning: unused variable 'did_bind' [-Wunused-variable] int did_bind =3D 0; ^ dnsmasq.c:54:9: warning: unused variable 'bound_device' [-Wunused-variabl= e] char *bound_device =3D NULL; ^ ... isc.c: In function 'dhcp_lease_new': isc.c:40:3: warning: ignoring return value of 'asprintf', declared with a= ttribute warn_unused_result [-Wunused-result] asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix); ^ =20 Asking about these warnings in the dnsmasq-list showed no reaction - no o= ne answered. =20 Best, Matthias =20 Signed-off-by: Matthias Fischer Signed-off-by: Michael Tremer commit 3b9815eb87e83a1b24e85ce0eab14a962b62ccd0 Author: Matthias Fischer Date: Fri Feb 26 18:29:28 2016 +0100 dnsmasq: 2.76test10 with latest patches (001-004) =20 This is 'dnsmasq 2.76test10', based on current 'next', containing latest = patches. =20 Signed-off-by: Matthias Fischer Signed-off-by: Michael Tremer ----------------------------------------------------------------------- Summary of changes: config/rootfiles/core/100/filelists/files | 1 + config/udev/60-net.rules | 2 +- lfs/dnsmasq | 40 +- ...q-Add-support-to-read-ISC-DHCP-lease-file.patch | 14 +- ...TL_parameter_to_--host-record_and_--cname.patch | 265 +++ ...01-include_0_0_0_0_8_in_DNS_rebind_checks.patch | 41 - .../dnsmasq/002-Add_--dhcp-ttl_option.patch | 117 ++ ...subnet_to_allow_arbitary_subnet_addresses.patch | 271 --- src/patches/dnsmasq/003-Update_CHANGELOG.patch | 17 + ...h_zones_locally_when_localise_queries_set.patch | 34 - .../dnsmasq/004-Add_--tftp-mtu_option.patch | 136 ++ .../004-fix_behaviour_of_empty_dhcp-option.patch | 38 - ...ease_length_to_TTL_when_--dhcp-ttl_in_use.patch | 37 + ...ution_to_ENOMEM_error_with_IPv6_multicast.patch | 50 - ...page_on_RDNSS_set_in_router_advertisement.patch | 35 - ...gned_dangling_CNAME_replies_to_DS_queries.patch | 30 - ...6_option_56_does_not_hold_an_address_list.patch | 25 - ...pect_the_--no_resolv_flag_in_inotify_code.patch | 47 - ..._5e3e464ac4022ee0b3794513abe510817e2cf3ca.patch | 26 - ...11-Catch_errors_from_sendmsg_in_DHCP_code.patch | 32 - ...12-Update_list_of_subnet_for_--bogus-priv.patch | 48 - ...y_address_from_DNS_overlays_A_record_from.patch | 43 - ...14-Handle_unknown_DS_hash_algos_correctly.patch | 39 - .../015-Fix_crash_at_start_up_with_conf-dir.patch | 38 - ...ajor_rationalisation_of_DNSSEC_validation.patch | 2209 ------------------= -- ...hing_RRSIGs_and_returning_them_from_cache.patch | 612 ------ ...caches_DS_records_to_a_more_logical_place.patch | 269 --- ...lise_RR-filtering_code_for_use_with_EDNS0.patch | 755 ------- .../dnsmasq/020-DNSSEC_validation_tweak.patch | 134 -- ...1-Tweaks_to_EDNS0_handling_in_DNS_replies.patch | 133 -- ..._code_Check_zone_status_is_NSEC_proof_bad.patch | 409 ---- ...023-Fix_brace_botch_in_dnssec_validate_ds.patch | 98 - ...ning_which_DNSSEC_sig_algos_are_supported.patch | 145 -- ...EDNS0_handling_and_computation_use_of_udp.patch | 643 ------ ...aks_in_handling_unknown_DNSSEC_algorithms.patch | 262 --- ...obscure_off-by-one_in_DNSSEC_hostname_cmp.patch | 27 - .../028-Minor_tweak_to_previous_commit.patch | 39 - .../dnsmasq/029-NSEC3_check_RFC5155_para_8_2.patch | 39 - 38 files changed, 589 insertions(+), 6611 deletions(-) create mode 100644 src/patches/dnsmasq/001-Add_TTL_parameter_to_--host-recor= d_and_--cname.patch delete mode 100644 src/patches/dnsmasq/001-include_0_0_0_0_8_in_DNS_rebind_c= hecks.patch create mode 100644 src/patches/dnsmasq/002-Add_--dhcp-ttl_option.patch delete mode 100644 src/patches/dnsmasq/002-enhance_add_subnet_to_allow_arbit= ary_subnet_addresses.patch create mode 100644 src/patches/dnsmasq/003-Update_CHANGELOG.patch delete mode 100644 src/patches/dnsmasq/003-dont_answer_non_auth_queries_for_= auth_zones_locally_when_localise_queries_set.patch create mode 100644 src/patches/dnsmasq/004-Add_--tftp-mtu_option.patch delete mode 100644 src/patches/dnsmasq/004-fix_behaviour_of_empty_dhcp-optio= n.patch create mode 100644 src/patches/dnsmasq/005-Apply_ceiling_of_lease_length_to_= TTL_when_--dhcp-ttl_in_use.patch delete mode 100644 src/patches/dnsmasq/005-suggest_solution_to_ENOMEM_error_= with_IPv6_multicast.patch delete mode 100644 src/patches/dnsmasq/006-clarify_man_page_on_RDNSS_set_in_= router_advertisement.patch delete mode 100644 src/patches/dnsmasq/007-handle_signed_dangling_CNAME_repl= ies_to_DS_queries.patch delete mode 100644 src/patches/dnsmasq/008-DHCPv6_option_56_does_not_hold_an= _address_list.patch delete mode 100644 src/patches/dnsmasq/009-Respect_the_--no_resolv_flag_in_i= notify_code.patch delete mode 100644 src/patches/dnsmasq/010-Rationalise_5e3e464ac4022ee0b3794= 513abe510817e2cf3ca.patch delete mode 100644 src/patches/dnsmasq/011-Catch_errors_from_sendmsg_in_DHCP= _code.patch delete mode 100644 src/patches/dnsmasq/012-Update_list_of_subnet_for_--bogus= -priv.patch delete mode 100644 src/patches/dnsmasq/013-Fix_crash_when_empty_address_from= _DNS_overlays_A_record_from.patch delete mode 100644 src/patches/dnsmasq/014-Handle_unknown_DS_hash_algos_corr= ectly.patch delete mode 100644 src/patches/dnsmasq/015-Fix_crash_at_start_up_with_conf-d= ir.patch delete mode 100644 src/patches/dnsmasq/016-Major_rationalisation_of_DNSSEC_v= alidation.patch delete mode 100644 src/patches/dnsmasq/017-Abandon_caching_RRSIGs_and_return= ing_them_from_cache.patch delete mode 100644 src/patches/dnsmasq/018-Move_code_which_caches_DS_records= _to_a_more_logical_place.patch delete mode 100644 src/patches/dnsmasq/019-Generalise_RR-filtering_code_for_= use_with_EDNS0.patch delete mode 100644 src/patches/dnsmasq/020-DNSSEC_validation_tweak.patch delete mode 100644 src/patches/dnsmasq/021-Tweaks_to_EDNS0_handling_in_DNS_r= eplies.patch delete mode 100644 src/patches/dnsmasq/022-Tidy_up_DNSSEC_non-existence_code= _Check_zone_status_is_NSEC_proof_bad.patch delete mode 100644 src/patches/dnsmasq/023-Fix_brace_botch_in_dnssec_validat= e_ds.patch delete mode 100644 src/patches/dnsmasq/024-Do_a_better_job_of_determining_wh= ich_DNSSEC_sig_algos_are_supported.patch delete mode 100644 src/patches/dnsmasq/025-Major_tidy_up_of_EDNS0_handling_a= nd_computation_use_of_udp.patch delete mode 100644 src/patches/dnsmasq/026-More_tweaks_in_handling_unknown_D= NSSEC_algorithms.patch delete mode 100644 src/patches/dnsmasq/027-Nasty_rare_and_obscure_off-by-one= _in_DNSSEC_hostname_cmp.patch delete mode 100644 src/patches/dnsmasq/028-Minor_tweak_to_previous_commit.pa= tch delete mode 100644 src/patches/dnsmasq/029-NSEC3_check_RFC5155_para_8_2.patch Difference in files: diff --git a/config/rootfiles/core/100/filelists/files b/config/rootfiles/cor= e/100/filelists/files index 1202ea8..b3cd418 100644 --- a/config/rootfiles/core/100/filelists/files +++ b/config/rootfiles/core/100/filelists/files @@ -6,6 +6,7 @@ etc/rc.d/init.d/firewall etc/rc.d/init.d/functions etc/rc.d/init.d/networking/dhcpcd.exe etc/modprobe.d/nf_conntrack.conf +lib/udev/rules.d/60-net.rules srv/web/ipfire/cgi-bin/logs.cgi/firewalllog.dat srv/web/ipfire/cgi-bin/logs.cgi/firewalllogcountry.dat srv/web/ipfire/cgi-bin/logs.cgi/firewalllogip.dat diff --git a/config/udev/60-net.rules b/config/udev/60-net.rules index dc39ff0..e82320c 100644 --- a/config/udev/60-net.rules +++ b/config/udev/60-net.rules @@ -4,4 +4,4 @@ ACTION=3D=3D"add", SUBSYSTEM=3D=3D"net", PROGRAM=3D"/lib/udev= /network-hotplug-rename", RES =20 # Call a script that will create all virtual devices for a parent device # that has just come up. -ACTION=3D=3D"add", SUBSYSTEM=3D=3D"net", PROGRAM=3D"/lib/udev/network-hotplu= g-vlan" +ACTION=3D=3D"add", SUBSYSTEM=3D=3D"net", RUN+=3D"/lib/udev/network-hotplug-v= lan" diff --git a/lfs/dnsmasq b/lfs/dnsmasq index 8058663..84585c1 100644 --- a/lfs/dnsmasq +++ b/lfs/dnsmasq @@ -1,7 +1,7 @@ ############################################################################= ### # = # # IPFire.org - A linux based firewall = # -# Copyright (C) 2015 Michael Tremer & Christian Schmidt = # +# Copyright (C) 2016 Michael Tremer & Christian Schmidt = # # = # # This program is free software: you can redistribute it and/or modify = # # it under the terms of the GNU General Public License as published by = # @@ -24,7 +24,7 @@ =20 include Config =20 -VER =3D 2.75 +VER =3D 2.76test10 =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 887236f1ddde6eb57cdb9d01916c9f72 +$(DL_FILE)_MD5 =3D 4b51474ed6081b18c61407077f254cf7 =20 install : $(TARGET) =20 @@ -73,35 +73,11 @@ $(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-include_0= _0_0_0_8_in_DNS_rebind_checks.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/002-enhance_a= dd_subnet_to_allow_arbitary_subnet_addresses.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/003-dont_answ= er_non_auth_queries_for_auth_zones_locally_when_localise_queries_set.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/004-fix_behav= iour_of_empty_dhcp-option.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/005-suggest_s= olution_to_ENOMEM_error_with_IPv6_multicast.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/006-clarify_m= an_page_on_RDNSS_set_in_router_advertisement.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/007-handle_si= gned_dangling_CNAME_replies_to_DS_queries.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/008-DHCPv6_op= tion_56_does_not_hold_an_address_list.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/009-Respect_t= he_--no_resolv_flag_in_inotify_code.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/010-Rationali= se_5e3e464ac4022ee0b3794513abe510817e2cf3ca.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/011-Catch_err= ors_from_sendmsg_in_DHCP_code.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/012-Update_li= st_of_subnet_for_--bogus-priv.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/013-Fix_crash= _when_empty_address_from_DNS_overlays_A_record_from.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/014-Handle_un= known_DS_hash_algos_correctly.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/015-Fix_crash= _at_start_up_with_conf-dir.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/016-Major_rat= ionalisation_of_DNSSEC_validation.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/017-Abandon_c= aching_RRSIGs_and_returning_them_from_cache.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/018-Move_code= _which_caches_DS_records_to_a_more_logical_place.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/019-Generalis= e_RR-filtering_code_for_use_with_EDNS0.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/020-DNSSEC_va= lidation_tweak.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/021-Tweaks_to= _EDNS0_handling_in_DNS_replies.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/022-Tidy_up_D= NSSEC_non-existence_code_Check_zone_status_is_NSEC_proof_bad.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/023-Fix_brace= _botch_in_dnssec_validate_ds.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/024-Do_a_bett= er_job_of_determining_which_DNSSEC_sig_algos_are_supported.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/025-Major_tid= y_up_of_EDNS0_handling_and_computation_use_of_udp.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/026-More_twea= ks_in_handling_unknown_DNSSEC_algorithms.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/027-Nasty_rar= e_and_obscure_off-by-one_in_DNSSEC_hostname_cmp.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/028-Minor_twe= ak_to_previous_commit.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/029-NSEC3_che= ck_RFC5155_para_8_2.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/001-Add_TTL_p= arameter_to_--host-record_and_--cname.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/002-Add_--dhc= p-ttl_option.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/003-Update_CH= ANGELOG.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/004-Add_--tft= p-mtu_option.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/005-Apply_cei= ling_of_lease_length_to_TTL_when_--dhcp-ttl_in_use.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-Add-support-to-read-ISC-DHCP-lease-file.patc= h b/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch index f55ebe8..703e94f 100644 --- a/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch +++ b/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch @@ -19,7 +19,7 @@ #ifdef HAVE_DNSSEC cache_blockdata_free(crecp); #endif -@@ -1131,7 +1134,7 @@ +@@ -1138,7 +1141,7 @@ =20 }=20 =20 @@ -28,7 +28,7 @@ struct in_addr a_record_from_hosts(char *name, time_t now) { struct crec *crecp =3D NULL; -@@ -1274,7 +1277,11 @@ +@@ -1281,7 +1284,11 @@ else crec->ttd =3D ttd; crec->addr.addr =3D *host_address; @@ -42,7 +42,7 @@ =20 --- a/src/dnsmasq.c Thu Jul 30 20:59:06 2015 +++ b/src/dnsmasq.c Wed Dec 16 19:38:32 2015 -@@ -982,6 +982,11 @@ +@@ -1013,6 +1013,11 @@ =20 poll_resolv(0, daemon->last_resolv !=3D 0, now); =20 daemon->last_resolv =3D now; @@ -56,7 +56,7 @@ =20 --- a/src/dnsmasq.h Wed Dec 16 19:24:12 2015 +++ b/src/dnsmasq.h Wed Dec 16 19:40:11 2015 -@@ -1513,8 +1513,12 @@ +@@ -1514,6 +1514,11 @@ void poll_listen(int fd, short event); int do_poll(int timeout); =20 @@ -326,7 +326,7 @@ +#endif --- a/src/option.c Wed Dec 16 19:24:12 2015 +++ b/src/option.c Wed Dec 16 19:42:48 2015 -@@ -1754,7 +1754,7 @@ +@@ -1769,7 +1769,7 @@ ret_err(_("bad MX target")); break; =20 @@ -341,8 +341,8 @@ helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \ dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o \ domain.o dnssec.o blockdata.o tables.o loop.o inotify.o \ -- poll.o rrfilter.o -+ poll.o rrfilter.o isc.o +- poll.o rrfilter.o edns0.o arp.o ++ poll.o rrfilter.o edns0.o arp.o isc.o =20 hdrs =3D dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \ dns-protocol.h radv-protocol.h ip6addr.h diff --git a/src/patches/dnsmasq/001-Add_TTL_parameter_to_--host-record_and_-= -cname.patch b/src/patches/dnsmasq/001-Add_TTL_parameter_to_--host-record_and= _--cname.patch new file mode 100644 index 0000000..86fbc9c --- /dev/null +++ b/src/patches/dnsmasq/001-Add_TTL_parameter_to_--host-record_and_--cname.= patch @@ -0,0 +1,265 @@ +From df3d54f776a3c9b60735b45c0b7fd88b66a2d5c4 Mon Sep 17 00:00:00 2001 +From: Simon Kelley +Date: Wed, 24 Feb 2016 21:03:38 +0000 +Subject: [PATCH] Add TTL parameter to --host-record and --cname. + +--- + man/dnsmasq.8 | 12 ++++++++++-- + src/cache.c | 7 +++++++ + src/dnsmasq.h | 2 ++ + src/option.c | 46 ++++++++++++++++++++++++++++++++++++++-------- + src/rfc1035.c | 6 +++++- + 5 files changed, 62 insertions(+), 11 deletions(-) + +diff --git a/man/dnsmasq.8 b/man/dnsmasq.8 +index b782eaf..7bc1394 100644 +--- a/man/dnsmasq.8 ++++ b/man/dnsmasq.8 +@@ -529,7 +529,7 @@ zone files: the port, weight and priority numbers are in= a different + order. More than one SRV record for a given service/domain is allowed, + all that match are returned. + .TP +-.B --host-record=3D[,....],[],[] ++.B --host-record=3D[,....],[],[][,<= TTL>] + Add A, AAAA and PTR records to the DNS. This adds one or more names to + the DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may + appear in more than one=20 +@@ -546,6 +546,10 @@ is in effect. Short and long names may appear in the sa= me + .B host-record, + eg.=20 + .B --host-record=3Dlaptop,laptop.thekelleys.org,192.168.0.1,1234::100 ++ ++If the time-to-live is given, it overrides the default, which is zero ++or the value of --local-ttl. The value is a positive integer and gives=20 ++the time-to-live in seconds. + .TP + .B \-Y, --txt-record=3D[[,],] + Return a TXT DNS record. The value of TXT record is a set of strings, +@@ -559,7 +563,7 @@ Return a PTR DNS record. + .B --naptr-record=3D,,,,,[= ,] + Return an NAPTR DNS record, as specified in RFC3403. + .TP +-.B --cname=3D, ++.B --cname=3D,[,] + Return a CNAME record which indicates that is really + . There are significant limitations on the target; it must be a + DNS name which is known to dnsmasq from /etc/hosts (or additional +@@ -568,6 +572,10 @@ hosts files), from DHCP, from --interface-name or from = another + If the target does not satisfy this + criteria, the whole cname is ignored. The cname must be unique, but it + is permissable to have more than one cname pointing to the same target. ++ ++If the time-to-live is given, it overrides the default, which is zero ++or the value of -local-ttl. The value is a positive integer and gives=20 ++the time-to-live in seconds. + .TP + .B --dns-rr=3D,,[] + Return an arbitrary DNS Resource Record. The number is the type of the +diff --git a/src/cache.c b/src/cache.c +index a9eaa65..4ecd535 100644 +--- a/src/cache.c ++++ b/src/cache.c +@@ -778,6 +778,7 @@ static void add_hosts_cname(struct crec *target) + (crec =3D whine_malloc(sizeof(struct crec)))) + { + crec->flags =3D F_FORWARD | F_IMMORTAL | F_NAMEP | F_CONFIG | F_CNAME; ++ crec->ttd =3D a->ttl; + crec->name.namep =3D a->alias; + crec->addr.cname.target.cache =3D target; + crec->addr.cname.uid =3D target->uid; +@@ -981,6 +982,7 @@ int read_hostsfile(char *filename, unsigned int index, i= nt cache_size, struct cr + strcat(cache->name.sname, "."); + strcat(cache->name.sname, domain_suffix); + cache->flags =3D flags; ++ cache->ttd =3D daemon->local_ttl; + add_hosts_entry(cache, &addr, addrlen, index, rhash, hashsz); + name_count++; + } +@@ -988,6 +990,7 @@ int read_hostsfile(char *filename, unsigned int index, i= nt cache_size, struct cr + { + strcpy(cache->name.sname, canon); + cache->flags =3D flags; ++ cache->ttd =3D daemon->local_ttl; + add_hosts_entry(cache, &addr, addrlen, index, rhash, hashsz); + name_count++; + } +@@ -1057,6 +1060,7 @@ void cache_reload(void) + ((cache =3D whine_malloc(sizeof(struct crec))))) + { + cache->flags =3D F_FORWARD | F_NAMEP | F_CNAME | F_IMMORTAL | F_CONFIG; ++ cache->ttd =3D a->ttl; + cache->name.namep =3D a->alias; + cache->addr.cname.target.int_name =3D intr; + cache->addr.cname.uid =3D SRC_INTERFACE; +@@ -1071,6 +1075,7 @@ void cache_reload(void) + (cache->addr.ds.keydata =3D blockdata_alloc(ds->digest, ds->digestlen))) + { + cache->flags =3D F_FORWARD | F_IMMORTAL | F_DS | F_CONFIG | F_NAMEP; ++ cache->ttd =3D daemon->local_ttl; + cache->name.namep =3D ds->name; + cache->addr.ds.keylen =3D ds->digestlen; + cache->addr.ds.algo =3D ds->algo; +@@ -1095,6 +1100,7 @@ void cache_reload(void) + (cache =3D whine_malloc(sizeof(struct crec)))) + { + cache->name.namep =3D nl->name; ++ cache->ttd =3D hr->ttl; + cache->flags =3D F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV4= | F_NAMEP | F_CONFIG; + add_hosts_entry(cache, (struct all_addr *)&hr->addr, INADDRSZ, SRC_CON= FIG, (struct crec **)daemon->packet, revhashsz); + } +@@ -1103,6 +1109,7 @@ void cache_reload(void) + (cache =3D whine_malloc(sizeof(struct crec)))) + { + cache->name.namep =3D nl->name; ++ cache->ttd =3D hr->ttl; + cache->flags =3D F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV6= | F_NAMEP | F_CONFIG; + add_hosts_entry(cache, (struct all_addr *)&hr->addr6, IN6ADDRSZ, SRC_C= ONFIG, (struct crec **)daemon->packet, revhashsz); + } +diff --git a/src/dnsmasq.h b/src/dnsmasq.h +index 6d1c5ae..6344df5 100644 +--- a/src/dnsmasq.h ++++ b/src/dnsmasq.h +@@ -308,6 +308,7 @@ struct ptr_record { + }; +=20 + struct cname { ++ int ttl; + char *alias, *target; + struct cname *next; + };=20 +@@ -344,6 +345,7 @@ struct auth_zone { +=20 +=20 + struct host_record { ++ int ttl; + struct name_list { + char *name; + struct name_list *next; +diff --git a/src/option.c b/src/option.c +index c98bdc9..7c5e6bc 100644 +--- a/src/option.c ++++ b/src/option.c +@@ -448,20 +448,20 @@ static struct { + { LOPT_GEN_NAMES, ARG_DUP, "[=3Dtag:]", gettext_noop("Generate hostn= ames based on MAC address for nameless clients."), NULL}, + { LOPT_PROXY, ARG_DUP, "[=3D]...", gettext_noop("Use these DHCP r= elays as full proxies."), NULL }, + { LOPT_RELAY, ARG_DUP, ",[,]", gettext_noo= p("Relay DHCP requests to a remote server"), NULL}, +- { LOPT_CNAME, ARG_DUP, ",", gettext_noop("Specify alias na= me for LOCAL DNS name."), NULL }, ++ { LOPT_CNAME, ARG_DUP, ",[,]", gettext_noop("Specify = alias name for LOCAL DNS name."), NULL }, + { LOPT_PXE_PROMT, ARG_DUP, ",[]", gettext_noop("Prompt t= o send to PXE clients."), NULL }, + { LOPT_PXE_SERV, ARG_DUP, "", gettext_noop("Boot service for PXE= menu."), NULL }, + { LOPT_TEST, 0, NULL, gettext_noop("Check configuration syntax."), NULL }, + { LOPT_ADD_MAC, ARG_DUP, "[=3Dbase64|text]", gettext_noop("Add requestor'= s MAC address to forwarded DNS queries."), NULL }, + { LOPT_ADD_SBNET, ARG_ONE, "[,]", gettext_noop("Add spe= cified IP subnet to forwarded DNS queries."), NULL }, +- { LOPT_CPE_ID, ARG_ONE, "", gettext_noop("Add client identificatio= n to forwarded DNS queries."), NULL }, ++ { LOPT_CPE_ID, ARG_ONE, "", gettext_noop("Add client identification= to forwarded DNS queries."), NULL }, + { LOPT_DNSSEC, OPT_DNSSEC_PROXY, NULL, gettext_noop("Proxy DNSSEC validat= ion results from upstream nameservers."), NULL }, + { LOPT_INCR_ADDR, OPT_CONSEC_ADDR, NULL, gettext_noop("Attempt to allocat= e sequential IP addresses to DHCP clients."), NULL }, + { LOPT_CONNTRACK, OPT_CONNTRACK, NULL, gettext_noop("Copy connection-trac= k mark from queries to upstream connections."), NULL }, + { LOPT_FQDN, OPT_FQDN_UPDATE, NULL, gettext_noop("Allow DHCP clients to d= o their own DDNS updates."), NULL }, + { LOPT_RA, OPT_RA, NULL, gettext_noop("Send router-advertisements for int= erfaces doing DHCPv6"), NULL }, + { LOPT_DUID, ARG_ONE, ",", gettext_noop("Specify DUID_E= N-type DHCPv6 server DUID"), NULL }, +- { LOPT_HOST_REC, ARG_DUP, ",
", gettext_noop("Specify host = (A/AAAA and PTR) records"), NULL }, ++ { LOPT_HOST_REC, ARG_DUP, ",
[,]", gettext_noop("Speci= fy host (A/AAAA and PTR) records"), NULL }, + { LOPT_RR, ARG_DUP, ",,[]", gettext_noop("Specify = arbitrary DNS resource record"), NULL }, + { LOPT_CLVERBIND, OPT_CLEVERBIND, NULL, gettext_noop("Bind to interfaces = in use - check for new interfaces"), NULL }, + { LOPT_AUTHSERV, ARG_ONE, ",", gettext_noop("Export local = names to global DNS"), NULL }, +@@ -3692,12 +3692,15 @@ static int one_opt(int option, char *arg, char *errs= tr, char *gen_err, int comma + case LOPT_CNAME: /* --cname */ + { + struct cname *new; +- char *alias; +- char *target; ++ char *alias, *target, *ttls; ++ int ttl =3D -1; +=20 + if (!(comma =3D split(arg))) + ret_err(gen_err); + =09 ++ if ((ttls =3D split(comma)) && !atoi_check(ttls, &ttl)) ++ ret_err(_("bad TTL")); ++=09 + alias =3D canonicalise_opt(arg); + target =3D canonicalise_opt(comma); + =20 +@@ -3713,6 +3716,7 @@ static int one_opt(int option, char *arg, char *errstr= , char *gen_err, int comma + daemon->cnames =3D new; + new->alias =3D alias; + new->target =3D target; ++ new->ttl =3D ttl; + } + =20 + break; +@@ -3913,14 +3917,22 @@ static int one_opt(int option, char *arg, char *errs= tr, char *gen_err, int comma + { + struct host_record *new =3D opt_malloc(sizeof(struct host_record)); + memset(new, 0, sizeof(struct host_record)); +-=09 ++ new->ttl =3D -1; ++ + if (!arg || !(comma =3D split(arg))) + ret_err(_("Bad host-record")); + =09 + while (arg) + { + struct all_addr addr; +- if (inet_pton(AF_INET, arg, &addr)) ++ char *dig; ++ ++ for (dig =3D arg; *dig !=3D 0; dig++) ++ if (*dig < '0' || *dig > '9') ++ break; ++ if (*dig =3D=3D 0) ++ new->ttl =3D atoi(arg); ++ else if (inet_pton(AF_INET, arg, &addr)) + new->addr =3D addr.addr.addr4; + #ifdef HAVE_IPV6 + else if (inet_pton(AF_INET6, arg, &addr)) +@@ -4601,7 +4613,25 @@ void read_opts(int argc, char **argv, char *compile_o= pts) + } + }=20 + } +- =20 ++ ++ if (daemon->host_records) ++ { ++ struct host_record *hr; ++ =20 ++ for (hr =3D daemon->host_records; hr; hr =3D hr->next) ++ if (hr->ttl =3D=3D -1) ++ hr->ttl =3D daemon->local_ttl; ++ } ++ ++ if (daemon->cnames) ++ { ++ struct cname *cn; ++ =20 ++ for (cn =3D daemon->cnames; cn; cn =3D cn->next) ++ if (cn->ttl =3D=3D -1) ++ cn->ttl =3D daemon->local_ttl; ++ } ++ + if (daemon->if_addrs) + { =20 + struct iname *tmp; +diff --git a/src/rfc1035.c b/src/rfc1035.c +index 9c0ddb5..3535a71 100644 +--- a/src/rfc1035.c ++++ b/src/rfc1035.c +@@ -1169,9 +1169,13 @@ static unsigned long crec_ttl(struct crec *crecp, tim= e_t now) + /* Return 0 ttl for DHCP entries, which might change + before the lease expires. */ +=20 +- if (crecp->flags & (F_IMMORTAL | F_DHCP)) ++ if (crecp->flags & F_DHCP) + return daemon->local_ttl; + =20 ++ /* Immortal entries other than DHCP are local, and hold TTL in TTD field.= */ ++ if (crecp->flags & F_IMMORTAL) ++ return crecp->ttd; ++ + /* Return the Max TTL value if it is lower then the actual TTL */ + if (daemon->max_ttl =3D=3D 0 || ((unsigned)(crecp->ttd - now) < daemon->m= ax_ttl)) + return crecp->ttd - now; +--=20 +1.7.10.4 + diff --git a/src/patches/dnsmasq/001-include_0_0_0_0_8_in_DNS_rebind_checks.p= atch b/src/patches/dnsmasq/001-include_0_0_0_0_8_in_DNS_rebind_checks.patch deleted file mode 100644 index 8a2557a..0000000 --- a/src/patches/dnsmasq/001-include_0_0_0_0_8_in_DNS_rebind_checks.patch +++ /dev/null @@ -1,41 +0,0 @@ -From d2aa7dfbb6d1088dcbea9fecc61b9293b320eb95 Mon Sep 17 00:00:00 2001 -From: Simon Kelley -Date: Mon, 3 Aug 2015 21:52:12 +0100 -Subject: [PATCH] Include 0.0.0.0/8 in DNS rebind checks. - ---- - CHANGELOG | 7 +++++++ - src/rfc1035.c | 3 ++- - 2 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/CHANGELOG b/CHANGELOG -index 901da47..3f4026d 100644 ---- a/CHANGELOG -+++ b/CHANGELOG -@@ -1,3 +1,10 @@ -+version 2.76 -+ Include 0.0.0.0/8 in DNS rebind checks. This range=20 -+ translates to hosts on the local network, or, at=20 -+ least, 0.0.0.0 accesses the local host, so could -+ be targets for DNS rebinding. See RFC 5735 section 3=20 -+ for details. Thanks to Stephen R=C3=83=C2=B6ttger for the bug report. -+ =20 - version 2.75 - Fix reversion on 2.74 which caused 100% CPU use when a=20 - dhcp-script is configured. Thanks to Adrian Davey for -diff --git a/src/rfc1035.c b/src/rfc1035.c -index 56647b0..29e9e65 100644 ---- a/src/rfc1035.c -+++ b/src/rfc1035.c -@@ -728,7 +728,8 @@ int private_net(struct in_addr addr, int ban_localhost) - in_addr_t ip_addr =3D ntohl(addr.s_addr); -=20 - return -- (((ip_addr & 0xFF000000) =3D=3D 0x7F000000) && ban_localhost) /* 127.0= .0.0/8 (loopback) */ ||=20 -+ (((ip_addr & 0xFF000000) =3D=3D 0x7F000000) && ban_localhost) /* 127.0= .0.0/8 (loopback) */ || -+ ((ip_addr & 0xFF000000) =3D=3D 0x00000000) /* RFC 5735 section 3. "her= e" network */ || - ((ip_addr & 0xFFFF0000) =3D=3D 0xC0A80000) /* 192.168.0.0/16 (private)= */ || - ((ip_addr & 0xFF000000) =3D=3D 0x0A000000) /* 10.0.0.0/8 (private)= */ || - ((ip_addr & 0xFFF00000) =3D=3D 0xAC100000) /* 172.16.0.0/12 (private)= */ || ---=20 -1.7.10.4 diff --git a/src/patches/dnsmasq/002-Add_--dhcp-ttl_option.patch b/src/patche= s/dnsmasq/002-Add_--dhcp-ttl_option.patch new file mode 100644 index 0000000..45e3b9b --- /dev/null +++ b/src/patches/dnsmasq/002-Add_--dhcp-ttl_option.patch @@ -0,0 +1,117 @@ +From 832e47beab95c2918b5264f0504f2fe6fe523e4c Mon Sep 17 00:00:00 2001 +From: Simon Kelley +Date: Wed, 24 Feb 2016 21:24:45 +0000 +Subject: [PATCH] Add --dhcp-ttl option. + +--- + man/dnsmasq.8 | 5 ++++- + src/dnsmasq.h | 2 +- + src/option.c | 13 +++++++++++-- + src/rfc1035.c | 2 +- + 4 files changed, 17 insertions(+), 5 deletions(-) + +diff --git a/man/dnsmasq.8 b/man/dnsmasq.8 +index 7bc1394..2bcce20 100644 +--- a/man/dnsmasq.8 ++++ b/man/dnsmasq.8 +@@ -60,7 +60,7 @@ in the same way as for DHCP-derived names. Note that this = does not + apply to domain names in cnames, PTR records, TXT records etc. + .TP + .B \-T, --local-ttl=3D