Re: [Dnsmasq-discuss] [PATCH] Re: dhcp-boot & dhcp-reply-delay optional tag fixes

2018-12-16 Thread Simon Kelley
Thanks both for this. Petr's more comprehensive patch is now in my tree.

Cheers,

Simon.





On 15/12/2018 09:43, Kevin Darbyshire-Bryant wrote:
> 
> 
>> On 14 Dec 2018, at 16:10, Petr Mensik  wrote:
>>
>> Hi Kevin et al,
>>
>> sure, your fix is correct one. I just found one more place where tags
>> were required. Your pointer handling is not as hopeless as you are
>> saying. :)
> 
> He he - It’s always good to get a second opinion though :-)  And you spotted 
> another place I missed as well.
> 
>>
>> Sorry for inconvenience caused by my change. I miss some tests that
>> would discover it, have to write them someday soon.
>>
>> Petr
> 
> It seems the openwrt users have a very wide range of use cases and notice 
> stuff ;-)
> 
> Your more complete fix is in openwrt master - thank you.
> 
> 
> 
> Cheers,
> 
> Kevin D-B
> 
> 012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] [PATCH] Re: dhcp-boot & dhcp-reply-delay optional tag fixes

2018-12-15 Thread Kevin Darbyshire-Bryant


> On 14 Dec 2018, at 16:10, Petr Mensik  wrote:
> 
> Hi Kevin et al,
> 
> sure, your fix is correct one. I just found one more place where tags
> were required. Your pointer handling is not as hopeless as you are
> saying. :)

He he - It’s always good to get a second opinion though :-)  And you spotted 
another place I missed as well.

> 
> Sorry for inconvenience caused by my change. I miss some tests that
> would discover it, have to write them someday soon.
> 
> Petr

It seems the openwrt users have a very wide range of use cases and notice stuff 
;-)

Your more complete fix is in openwrt master - thank you.



Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] [PATCH] Re: dhcp-boot & dhcp-reply-delay optional tag fixes

2018-12-14 Thread Petr Mensik
Hi Kevin et al,

sure, your fix is correct one. I just found one more place where tags
were required. Your pointer handling is not as hopeless as you are
saying. :)

Sorry for inconvenience caused by my change. I miss some tests that
would discover it, have to write them someday soon.

Petr
On 12/14/18 3:17 PM, Kevin Darbyshire-Bryant wrote:
> Hi Simon et al,
> 
> It looks like Petr’s "Free config file values on parsing errors” commit 
> turned the optional tags on dhcp-boot & dhcp-reply-delay to non-optional.
> 
> Attached is a patch that fixes it according to my testing but my ‘c’ and 
> pointer handling is somewhat hopeless so could do with a proper sanity check, 
> i.e. I don’t trust myself :-)
> 
> Cheers,
> 
> Kevin D-B
> 
> 012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A
> 
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 

-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemen...@redhat.com  PGP: 65C6C973
>From 668b45c29c38d440c8fce4bc994c56910adc3919 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= 
Date: Fri, 14 Dec 2018 17:03:08 +0100
Subject: [PATCH] Fix required tags in few places

Some locations were incorrectly changed to require always tags, else
dnsmasq will not start. Fix dhcp-boot, dhcp-reply-delay and pxe-prompt.
---
 src/option.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/option.c b/src/option.c
index 4627969..e32a8e8 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3432,7 +3432,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
   {
 	struct dhcp_netid *id = dhcp_tags();
 	
-	if (!id)
+	if (!arg)
 	  {
 	ret_err(gen_err);
 	  }
@@ -3483,7 +3483,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
   {
 	struct dhcp_netid *id = dhcp_tags();
 	
-	if (!id)
+	if (!arg)
 	  {
 	ret_err(gen_err);
 	  }
@@ -3513,7 +3513,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
 	 new->opt = 10; /* PXE_MENU_PROMPT */
 	 new->netid = dhcp_tags();
 	 
-	 if (!new->netid)
+	 if (!arg)
 	   {
 	 dhcp_opt_free(new);
 	 ret_err(gen_err);
-- 
2.14.5

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss