[Dnsmasq-discuss] [PATCH] Fix getsockname error return check.

Reiter Wolfgang wr0112358 at gmail.com
Tue Jan 3 12:19:03 GMT 2017


---
Hello,

getsockname return check is wrong.

Best regards,
Wolfgang 

 src/netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/netlink.c b/src/netlink.c
index 8cd51af..be9701c 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -73,7 +73,7 @@ void netlink_init(void)
     }
   
   if (daemon->netlinkfd == -1 || 
-      getsockname(daemon->netlinkfd, (struct sockaddr *)&addr, &slen) == 1)
+      getsockname(daemon->netlinkfd, (struct sockaddr *)&addr, &slen) == -1)
     die(_("cannot create netlink socket: %s"), NULL, EC_MISC);
    
   /* save pid assigned by bind() and retrieved by getsockname() */ 
-- 
2.9.3




More information about the Dnsmasq-discuss mailing list