Skip to contentSkip to conversation

resolve: fix runtime error if netconfig is not enabled

PATCH In review James Prestwood 2 participants 2 messages Nov 13, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 resolve: fix runtime error if netconfig is not enabled

If the resolve module was not enabled in the config file, IWD fails to start since resolve_init was returning -EINVAL. Since netconfig is optional, we just return successfully here.

---
 src/resolve.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/resolve.c +2 -1
index 83ac3547..fea9c2bd 100644
@@ -427,8 +427,9 @@ void __resolve_set_config(struct l_settings *config)
 
 static int resolve_init(void)
 {
+	/* This module is not enabled in config */
 	if (!method.ops)
-		return -EINVAL;
+		return 0;
 
 	if (method.ops->init)
 		method.data = method.ops->init();
Signature · 1 line
2.17.1
#1 lore raw

Hi James,

Quoted 6 lines

If the resolve module was not enabled in the config file, IWD fails to start since resolve_init was returning -EINVAL. Since netconfig is optional, we just return successfully here.
---
src/resolve.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)

patch has been applied.

Regards

Marcel