dnsmasq: 2.76test10 with latest patch (005) and some fixes
Message ID | 1456586985-26571-1-git-send-email-matthias.fischer@ipfire.org |
---|---|
State | Accepted |
Commit | a6cd8b9b5d903da27fef106329c892e372753e5f |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (hedwig.ipfire.org [172.28.1.200]) by web02.ipfire.org (Postfix) with ESMTP id A415D612C4 for <patchwork@ipfire.org>; Sat, 27 Feb 2016 16:29:55 +0100 (CET) Received: from mail01.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id DE8C9129A; Sat, 27 Feb 2016 16:29:54 +0100 (CET) Received: from Devel.localdomain (p5DD83498.dip0.t-ipconnect.de [93.216.52.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id C7121C09 for <development@lists.ipfire.org>; Sat, 27 Feb 2016 16:29:51 +0100 (CET) From: Matthias Fischer <matthias.fischer@ipfire.org> To: development@lists.ipfire.org Subject: [PATCH] dnsmasq: 2.76test10 with latest patch (005) and some fixes Date: Sat, 27 Feb 2016 16:29:45 +0100 Message-Id: <1456586985-26571-1-git-send-email-matthias.fischer@ipfire.org> X-Mailer: git-send-email 2.7.2 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <http://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <http://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Message
Matthias Fischer
Feb. 28, 2016, 2:29 a.m. UTC
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(<dhcp-ttl>, <lease-expire-time> -
<now>)). Otherwise, dns might hand out a high TTL for a dhcp-lease
which expires one second later.
...
Seems a sensible addition.
Cheers,
Simon."
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.
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 = 0;
^
dnsmasq.c:54:9: warning: unused variable 'bound_device' [-Wunused-variable]
char *bound_device = NULL;
^
...
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]
asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix);
^
Asking about these warnings in the dnsmasq-list showed no reaction - no one answered.
Best,
Matthias
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
---
lfs/dnsmasq | 1 +
...q-Add-support-to-read-ISC-DHCP-lease-file.patch | 14 ++++----
...ease_length_to_TTL_when_--dhcp-ttl_in_use.patch | 37 ++++++++++++++++++++++
3 files changed, 45 insertions(+), 7 deletions(-)
create mode 100644 src/patches/dnsmasq/005-Apply_ceiling_of_lease_length_to_TTL_when_--dhcp-ttl_in_use.patch
Comments
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(<dhcp-ttl>, <lease-expire-time> - > <now>)). Otherwise, dns might hand out a high TTL for a dhcp-lease > which expires one second later. > ... > Seems a sensible addition. > > Cheers, > > Simon." > > 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. > > 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 = 0; > ^ > dnsmasq.c:54:9: warning: unused variable 'bound_device' [-Wunused- > variable] > char *bound_device = NULL; > ^ > ... > 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] > asprintf(&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? > ^ > > Asking about these warnings in the dnsmasq-list showed no reaction - > no one answered. > > Best, > Matthias > > Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org> > --- > lfs/dnsmasq | 1 + > ...q-Add-support-to-read-ISC-DHCP-lease-file.patch | 14 ++++---- > ...ease_length_to_TTL_when_--dhcp-ttl_in_use.patch | 37 > ++++++++++++++++++++++ > 3 files changed, 45 insertions(+), 7 deletions(-) > create mode 100644 src/patches/dnsmasq/005- > Apply_ceiling_of_lease_length_to_TTL_when_--dhcp-ttl_in_use.patch > > 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)) > cd $(DIR_APP) && patch -Np1 -i > $(DIR_SRC)/src/patches/dnsmasq/002-Add_--dhcp-ttl_option.patch > cd $(DIR_APP) && patch -Np1 -i > $(DIR_SRC)/src/patches/dnsmasq/003-Update_CHANGELOG.patch > 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 > 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-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 @@ > #ifdef HAVE_DNSSEC > cache_blockdata_free(crecp); > #endif > -@@ -1131,7 +1134,7 @@ > +@@ -1138,7 +1141,7 @@ > > } > > @@ -28,7 +28,7 @@ > struct in_addr a_record_from_hosts(char *name, time_t now) > { > struct crec *crecp = NULL; > -@@ -1274,7 +1277,11 @@ > +@@ -1281,7 +1284,11 @@ > else > crec->ttd = ttd; > crec->addr.addr = *host_address; > @@ -42,7 +42,7 @@ > > --- 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 @@ > > poll_resolv(0, daemon->last_resolv != 0, now); > daemon->last_resolv = now; > @@ -56,7 +56,7 @@ > > --- 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); > > @@ -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; > > @@ -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 > > hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \ > dns-protocol.h radv-protocol.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 <simon@thekelleys.org.uk> > +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 | 12 ++++++++++-- > + 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) > + { > + /* Return 0 ttl for DHCP entries, which might change > +- before the lease expires. */ > ++ before the lease expires, unless configured otherwise. */ > + > + if (crecp->flags & F_DHCP) > +- return daemon->use_dhcp_ttl ? daemon->dhcp_ttl : daemon- > >local_ttl; > ++ { > ++ int conf_ttl = daemon->use_dhcp_ttl ? daemon->dhcp_ttl : > daemon->local_ttl; > ++ > ++ /* Apply ceiling of actual lease length to configured TTL. */ > ++ if (!(crecp->flags & F_IMMORTAL) && (crecp->ttd - now) < > conf_ttl) > ++ return crecp->ttd - now; > ++ > ++ return conf_ttl; > ++ } > + > + /* Immortal entries other than DHCP are local, and hold TTL in > TTD field. */ > + if (crecp->flags & F_IMMORTAL) > +-- > +1.7.10.4 > +
Hi, On 28.02.2016 21:14, Michael Tremer wrote: >> > 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 = 0; >> > ^ >> > dnsmasq.c:54:9: warning: unused variable 'bound_device' [-Wunused- >> > variable] >> > char *bound_device = NULL; >> > ^ >> > ... >> > 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] >> > asprintf(&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? > Indeed I did, but you're right - I'll take a very close look at this! It could be that I somehow got tricked by 'git stash'... Best, Matthias
Hi, On 29.02.2016 18:40, Matthias Fischer wrote: > Hi, >>> > ... >> I *think* I fixed that in my branch when we talked about this the last >> time. Did you pull the changes from my repository? >> > > Indeed I did, but you're right - I'll take a very close look at this! > > It could be that I somehow got tricked by 'git stash'... Ok, found it. Sorry - I GOT tricked by 'stash'. I integrated your patch, but somehow forgot to save it (send/push). Work in progress. Best, Matthias