From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] dnsmasq: 2.76test10 with latest patch (005) and some fixes Date: Sun, 28 Feb 2016 12:14:41 -0800 Message-ID: <1456690481.2371.7.camel@ipfire.org> In-Reply-To: <1456586985-26571-1-git-send-email-matthias.fischer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8313807045640429309==" List-Id: --===============8313807045640429309== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, On Sat, 2016-02-27 at 16:29 +0100, Matthias Fischer wrote: > 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] > =C2=A0=C2=A0=C2=A0int did_bind =3D 0; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0^ > dnsmasq.c:54:9: warning: unused variable 'bound_device' [-Wunused- > variable] > =C2=A0=C2=A0=C2=A0char *bound_device =3D NULL; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0^ > ... > isc.c: In function 'dhcp_lease_new': > isc.c:40:3: warning: ignoring return value of 'asprintf', declared > with attribute warn_unused_result [-Wunused-result] > =C2=A0=C2=A0=C2=A0asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_= suffix); I *think* I fixed that in my branch when we talked about this the last time. Did you pull the changes from my repository? > =C2=A0=C2=A0=C2=A0^ >=20 > Asking about these warnings in the dnsmasq-list showed no reaction - > no one answered. >=20 > Best, > Matthias >=20 > Signed-off-by: Matthias Fischer > --- > =C2=A0lfs/dnsmasq=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0|=C2=A0=C2=A01 + > =C2=A0...q-Add-support-to-read-ISC-DHCP-lease-file.patch | 14 ++++---- > =C2=A0...ease_length_to_TTL_when_--dhcp-ttl_in_use.patch | 37 > ++++++++++++++++++++++ > =C2=A03 files changed, 45 insertions(+), 7 deletions(-) > =C2=A0create mode 100644 src/patches/dnsmasq/005- > Apply_ceiling_of_lease_length_to_TTL_when_--dhcp-ttl_in_use.patch >=20 > diff --git a/lfs/dnsmasq b/lfs/dnsmasq > index 29d7895..84585c1 100644 > --- a/lfs/dnsmasq > +++ b/lfs/dnsmasq > @@ -77,6 +77,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) > =C2=A0 cd $(DIR_APP) && patch -Np1 -i > $(DIR_SRC)/src/patches/dnsmasq/002-Add_--dhcp-ttl_option.patch > =C2=A0 cd $(DIR_APP) && patch -Np1 -i > $(DIR_SRC)/src/patches/dnsmasq/003-Update_CHANGELOG.patch > =C2=A0 cd $(DIR_APP) && patch -Np1 -i > $(DIR_SRC)/src/patches/dnsmasq/004-Add_--tftp-mtu_option.patch > + cd $(DIR_APP) && patch -Np1 -i > $(DIR_SRC)/src/patches/dnsmasq/005- > Apply_ceiling_of_lease_length_to_TTL_when_--dhcp-ttl_in_use.patch > =C2=A0 cd $(DIR_APP) && patch -Np1 -i > $(DIR_SRC)/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease- > file.patch > =C2=A0 > =C2=A0 cd $(DIR_APP) && sed -i src/config.h \ > diff --git 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 > 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 @@ > =C2=A0 #ifdef HAVE_DNSSEC > =C2=A0=C2=A0=C2=A0=C2=A0cache_blockdata_free(crecp); > =C2=A0 #endif > -@@ -1131,7 +1134,7 @@ > +@@ -1138,7 +1141,7 @@ > =C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0 }=C2=A0 > =C2=A0=C2=A0 > @@ -28,7 +28,7 @@ > =C2=A0 struct in_addr a_record_from_hosts(char *name, time_t now) > =C2=A0 { > =C2=A0=C2=A0=C2=A0=C2=A0struct crec *crecp =3D NULL; > -@@ -1274,7 +1277,11 @@ > +@@ -1281,7 +1284,11 @@ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0else > =C2=A0=C2=A0 crec->ttd =3D ttd; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0crec->addr.addr =3D *host_a= ddress; > @@ -42,7 +42,7 @@ > =C2=A0=C2=A0 > =C2=A0--- a/src/dnsmasq.c Thu Jul 30 20:59:06 2015 > =C2=A0+++ b/src/dnsmasq.c Wed Dec 16 19:38:32 2015 > -@@ -982,6 +982,11 @@ > +@@ -1013,6 +1013,11 @@ > =C2=A0=C2=A0 > =C2=A0=C2=A0 =C2=A0=C2=A0poll_resolv(0, daemon->last_resolv !=3D 0, now);= =C2=A0 =C2=A0=C2=A0 > =C2=A0=C2=A0 =C2=A0=C2=A0daemon->last_resolv =3D now; > @@ -56,7 +56,7 @@ > =C2=A0=C2=A0 > =C2=A0--- a/src/dnsmasq.h Wed Dec 16 19:24:12 2015 > =C2=A0+++ b/src/dnsmasq.h Wed Dec 16 19:40:11 2015 > -@@ -1513,8 +1513,12 @@ > +@@ -1514,6 +1514,11 @@ > =C2=A0 void poll_listen(int fd, short event); > =C2=A0 int do_poll(int timeout); > =C2=A0=C2=A0 > @@ -326,7 +326,7 @@ > =C2=A0+#endif > =C2=A0--- a/src/option.c Wed Dec 16 19:24:12 2015 > =C2=A0+++ b/src/option.c Wed Dec 16 19:42:48 2015 > -@@ -1754,7 +1754,7 @@ > +@@ -1769,7 +1769,7 @@ > =C2=A0=C2=A0 ret_err(_("bad MX target")); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0break; > =C2=A0=C2=A0 > @@ -341,8 +341,8 @@ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0helper.o tftp.o log.o= conntrack.o dhcp6.o rfc3315.o \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0dhcp-common.o outpack= et.o radv.o slaac.o auth.o ipset.o \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0domain.o dnssec.o blo= ckdata.o tables.o loop.o inotify.o \ > --=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0poll.o rrfilter.o > -+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0poll.o rrfilter.o isc.o > +-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0poll.o rrfilter.o edns0.o arp.o > ++=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0poll.o rrfilter.o edns0.o arp.o= isc.o > =C2=A0=C2=A0 > =C2=A0 hdrs =3D dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0dns-protocol.h radv-p= rotocol.h ip6addr.h > diff --git a/src/patches/dnsmasq/005- > Apply_ceiling_of_lease_length_to_TTL_when_--dhcp-ttl_in_use.patch > b/src/patches/dnsmasq/005-Apply_ceiling_of_lease_length_to_TTL_when_- > -dhcp-ttl_in_use.patch > new file mode 100644 > index 0000000..2875d2c > --- /dev/null > +++ b/src/patches/dnsmasq/005- > Apply_ceiling_of_lease_length_to_TTL_when_--dhcp-ttl_in_use.patch > @@ -0,0 +1,37 @@ > +From 7480aeffc8ad195e9fd8bcf424bae0fab3839d55 Mon Sep 17 00:00:00 > 2001 > +From: Simon Kelley > +Date: Fri, 26 Feb 2016 21:58:20 +0000 > +Subject: [PATCH] Apply ceiling of lease length to TTL when --dhcp- > ttl in use. > + > +--- > + src/rfc1035.c |=C2=A0=C2=A0=C2=A012 ++++++++++-- > + 1 file changed, 10 insertions(+), 2 deletions(-) > + > +diff --git a/src/rfc1035.c b/src/rfc1035.c > +index 8f1e3b4..bed5312 100644 > +--- a/src/rfc1035.c > ++++ b/src/rfc1035.c > +@@ -1167,10 +1167,18 @@ int add_resource_record(struct dns_header > *header, char *limit, int *truncp, int > + static unsigned long crec_ttl(struct crec *crecp, time_t now) > + { > +=C2=A0=C2=A0=C2=A0/* Return 0 ttl for DHCP entries, which might change > +-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0before the lease expires. */ > ++=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0before the lease expires, unless configured= otherwise. */ > +=C2=A0 > +=C2=A0=C2=A0=C2=A0if (crecp->flags & F_DHCP) > +-=C2=A0=C2=A0=C2=A0=C2=A0return daemon->use_dhcp_ttl ? daemon->dhcp_ttl : = daemon- > >local_ttl; > ++=C2=A0=C2=A0=C2=A0=C2=A0{ > ++=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int conf_ttl =3D daemon->use_dhcp_ttl= ? daemon->dhcp_ttl : > daemon->local_ttl; > ++=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > ++=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* Apply ceiling of actual lease leng= th to configured TTL. */ > ++=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (!(crecp->flags & F_IMMORTAL) && (= crecp->ttd - now) < > conf_ttl) > ++ return crecp->ttd - now; > ++=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > ++=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return conf_ttl; > ++=C2=A0=C2=A0=C2=A0=C2=A0} =C2=A0=C2=A0 > +=C2=A0=C2=A0=C2=A0 > +=C2=A0=C2=A0=C2=A0/* Immortal entries other than DHCP are local, and hold = TTL in > TTD field. */ > +=C2=A0=C2=A0=C2=A0if (crecp->flags & F_IMMORTAL) > +--=C2=A0 > +1.7.10.4 > + --===============8313807045640429309== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjIKCmlRSWNCQUFC Q2dBR0JRSlcwMVV4QUFvSkVJQjU4UDl2a0FrSE9CTVFBS0J2bzFFY0FGc2VqdVNSa0hNYVJwSDYK Ri9wL2NMVFJaVWtIV1JCRWRqMzFQSkdrYk5uZzJOelQ1eVFsYno0bURMVGJkS3IyN0ZSUGk1dndJ QmozckkvbwpOdDdUaTlzZmE4QkN3K2VHTlBkWm1OV0p0N1YrL0owbno1NnVwaEh5QzhENC9kdDJz N0FSdWQyNG1kcWJteXEzClZwZzRxN3NCTjYyWVQ4N1ZGNGY3aG54MnBTckdJWlpyaWEyTkw3S1NH ZVB0Z2Q0RXh1OGpTcU9zekZVZGxuaVgKa2QrSEJpcXlmR1JOeHA3dU5OUzhRcnNQa1ZXOElaSi9K S1hHMWdZRyswZUxhYjZvZFJxSm5paW90RmZDU1RaLwpBdjZVQm10ckNRaGR3LzZWRmppbWVQY1FR UHhZN1cvS3ZlRUpoa3FVREY5K2V2YWdPMWRBZ081M3hldkVYYlh4CmFBcVlpNk1IcWVUNGlrelEz a3Jia0szSCt6czcwWmdVclVvQmE5aHVHM2hZclZCSUlQVWVNeTRubHV6OER0SXUKNWRTSVIvU1NO b0k5UUpuWjVnVG55LzdqOGZjRXFmanZQOHVucEhCdWVmQm9adFNwbVd1dVd2SU9XQnp2SWhEcAp2 Vng2U0h3SktHNHFkenNCRzBNSzFweTVMWkdabFNyNXRGemFaUzdCLytIL1pnQXgzTjlkREM0bTVm T01YaGttClBIa1lCTWxJWXlSSlY4elpKZHpnMnArcm5iS1k5SkI0NWNPL1BuMmg0c3Q2UWFiY3RU b1dYSXpqc053OE9RVG0Ka2tCSDRHT2lzMUZhS3pQQ3hPSlF2cUNvUXc1L2IzNmh2bkgwYkZBWFBC elNKY1NicFJQZDZBN3FJT2FkUGw1dAprMVhUeWRxYmtLeWVBb09LLzg5Mgo9WkFVcAotLS0tLUVO RCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============8313807045640429309==--