summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch
blob: 89a8a572602076deb2bcba098de182abcc05a17d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Fixes errors like
sm-notify[1070]: DNS resolution of a.b.c.d..com failed; retrying later
This error will occur anytime sm-notify is run before the network if fully up,
which is happening more and more with parallel startup systems.
The res_init() call is simple, safe, quick, and a patch to use it should be
able to go upstream.  Presumably the whole reason sm-notify tries several
times is to wait for possible changes to the network configuration, but without
calling res_init() it will never be aware of those changes

Backported drom Fedora

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>


Index: nfs-utils-2.1.1/utils/statd/sm-notify.c
===================================================================
--- nfs-utils-2.1.1.orig/utils/statd/sm-notify.c
+++ nfs-utils-2.1.1/utils/statd/sm-notify.c
@@ -28,6 +28,9 @@
 #include <netdb.h>
 #include <errno.h>
 #include <grp.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
 
 #include "conffile.h"
 #include "sockaddr.h"
@@ -89,6 +92,7 @@ smn_lookup(const char *name)
 	};
 	int error;
 
+	res_init();
 	error = getaddrinfo(name, NULL, &hint, &ai);
 	if (error != 0) {
 		xlog(D_GENERAL, "getaddrinfo(3): %s", gai_strerror(error));