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?= <pemen...@redhat.com>
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(&arg);
 	
-	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(&arg);
 	
-	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(&arg);
 	 
-	 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

Reply via email to