]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Call res_init in case of failure to resolv names
authorVincent Bernat <vbernat.ext@orange-ftgroup.com>
Fri, 6 Mar 2009 10:55:30 +0000 (11:55 +0100)
committerVincent Bernat <vbernat.ext@orange-ftgroup.com>
Fri, 6 Mar 2009 11:22:09 +0000 (12:22 +0100)
src/priv.c

index 21f4bf9906559c876058253cefc79944d8580da4..e087cca456c8a1e6f8cf840a6d112d3454eef6fb 100644 (file)
@@ -39,6 +39,9 @@
 #include <netdb.h>
 #include <linux/sockios.h>
 #include <linux/if_packet.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
 
 enum {
        PRIV_PING,
@@ -235,7 +238,8 @@ asroot_gethostbyname()
        if (uname(&un) != 0)
                fatal("[priv]: failed to get system information");
        if ((hp = gethostbyname(un.nodename)) == NULL) {
-                LLOG_WARN("[priv]: unable to get system name");
+               LLOG_INFO("[priv]: unable to get system name");
+               res_init();
                 len = strlen(un.nodename);
                 must_write(remote, &len, sizeof(int));
                 must_write(remote, un.nodename, len + 1);