diff mbox

[LEDE-DEV,mdns] Check correct attributes when loading service from blob

Message ID 20170210134836.27739-1-zajec5@gmail.com
State Accepted
Headers show

Commit Message

Rafał Miłecki Feb. 10, 2017, 1:48 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

We access SERVICE_TXT so we should check for this entry. Checking
SERVICE_SERVICE doesn't make sense anyway as it's verified few lines
above (in the same funcion).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 service.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

John Crispin Feb. 10, 2017, 2:11 p.m. UTC | #1
On 10/02/2017 14:48, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> We access SERVICE_TXT so we should check for this entry. Checking
> SERVICE_SERVICE doesn't make sense anyway as it's verified few lines
> above (in the same funcion).
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>


Acked-by: John Crispin <john@phrozen.org>



> ---
>  service.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/service.c b/service.c
> index bb87aff..45b9345 100644
> --- a/service.c
> +++ b/service.c
> @@ -229,7 +229,7 @@ service_load_blob(struct blob_attr *b)
>  	if (!_tb[SERVICE_PORT] || !_tb[SERVICE_SERVICE])
>  		return;
>  
> -	if (_tb[SERVICE_SERVICE])
> +	if (_tb[SERVICE_TXT])
>  		blobmsg_for_each_attr(txt, _tb[SERVICE_TXT], rem2)
>  			txt_len += 1 + strlen(blobmsg_get_string(txt));
>  
> @@ -248,7 +248,7 @@ service_load_blob(struct blob_attr *b)
>  	s->txt_len = txt_len;
>  	s->txt = d_txt;
>  
> -	if (_tb[SERVICE_SERVICE])
> +	if (_tb[SERVICE_TXT])
>  		blobmsg_for_each_attr(txt, _tb[SERVICE_TXT], rem2) {
>  			int len = strlen(blobmsg_get_string(txt));
>  			if (!len)
>
diff mbox

Patch

diff --git a/service.c b/service.c
index bb87aff..45b9345 100644
--- a/service.c
+++ b/service.c
@@ -229,7 +229,7 @@  service_load_blob(struct blob_attr *b)
 	if (!_tb[SERVICE_PORT] || !_tb[SERVICE_SERVICE])
 		return;
 
-	if (_tb[SERVICE_SERVICE])
+	if (_tb[SERVICE_TXT])
 		blobmsg_for_each_attr(txt, _tb[SERVICE_TXT], rem2)
 			txt_len += 1 + strlen(blobmsg_get_string(txt));
 
@@ -248,7 +248,7 @@  service_load_blob(struct blob_attr *b)
 	s->txt_len = txt_len;
 	s->txt = d_txt;
 
-	if (_tb[SERVICE_SERVICE])
+	if (_tb[SERVICE_TXT])
 		blobmsg_for_each_attr(txt, _tb[SERVICE_TXT], rem2) {
 			int len = strlen(blobmsg_get_string(txt));
 			if (!len)