summaryrefslogtreecommitdiffstats
path: root/utils/statd
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2007-03-20 16:17:27 +1100
committerNeil Brown <neilb@suse.de>2007-03-20 16:17:27 +1100
commitfc023f58a146bca6e67b26878ff35f2368b19f58 (patch)
tree0e910ecf3515f095df2457ebae6aab657e43535a /utils/statd
parent742190194badb6f08a4934c254d642cbf014c84e (diff)
downloadnfs-utils-fc023f58a146bca6e67b26878ff35f2368b19f58.tar.gz
nfs-utils-fc023f58a146bca6e67b26878ff35f2368b19f58.tar.xz
nfs-utils-fc023f58a146bca6e67b26878ff35f2368b19f58.zip
statd - remove try_to_resolve
try_to_resolve is used to resolve a hostname when sending a notification. But we now only send notifications to localhost, so name resolution is not needed.
Diffstat (limited to 'utils/statd')
-rw-r--r--utils/statd/rmtcall.c62
1 files changed, 2 insertions, 60 deletions
diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c
index 362e1f6..816a6f3 100644
--- a/utils/statd/rmtcall.c
+++ b/utils/statd/rmtcall.c
@@ -84,62 +84,6 @@ statd_get_socket(void)
return sockfd;
}
-/*
- * Try to resolve host name for notify/callback request
- *
- * When compiled with RESTRICTED_STATD defined, we expect all
- * host names to be dotted quads. See monitor.c for details. --okir
- */
-#ifdef RESTRICTED_STATD
-static int
-try_to_resolve(notify_list *lp)
-{
- char *hname;
-
- hname = NL_MY_NAME(lp);
- if (!inet_aton(hname, &(NL_ADDR(lp)))) {
- note(N_ERROR, "%s is not an dotted-quad address", hname);
- NL_TIMES(lp) = 0;
- return 0;
- }
-
- /* XXX: In order to handle multi-homed hosts, we could do
- * a reverse lookup, a forward lookup, and cycle through
- * all the addresses.
- */
- return 1;
-}
-#else
-static int
-try_to_resolve(notify_list *lp)
-{
- struct hostent *hp;
- char *hname;
-
- hname = NL_MY_NAME(lp);
-
- dprintf(N_DEBUG, "Trying to resolve %s.", hname);
- if (!(hp = gethostbyname(hname))) {
- herror("gethostbyname");
- NL_TIMES(lp) -= 1;
- return 0;
- }
-
- if (hp->h_addrtype != AF_INET) {
- note(N_ERROR, "%s is not an AF_INET address", hname);
- NL_TIMES(lp) = 0;
- return 0;
- }
-
- /* FIXME: should try all addresses for multi-homed hosts in
- * alternation because one interface might be down/unreachable. */
- NL_ADDR(lp) = *(struct in_addr *) hp->h_addr;
-
- dprintf(N_DEBUG, "address of %s is %s", hname, inet_ntoa(NL_ADDR(lp)));
- return 1;
-}
-#endif
-
static unsigned long
xmit_call(int sockfd, struct sockaddr_in *sin,
u_int32_t prog, u_int32_t vers, u_int32_t proc,
@@ -292,8 +236,6 @@ process_entry(int sockfd, notify_list *lp)
u_int32_t proc, vers, prog;
/* __u32 proc, vers, prog; */
- if (lp->addr.s_addr == INADDR_ANY && !try_to_resolve(lp))
- return NL_TIMES(lp);
if (NL_TIMES(lp) == 0) {
note(N_DEBUG, "Cannot notify %s, giving up.\n",
inet_ntoa(NL_ADDR(lp)));
@@ -321,8 +263,8 @@ process_entry(int sockfd, notify_list *lp)
lp->xid = xmit_call(sockfd, &sin, prog, vers, proc, func, objp);
if (!lp->xid) {
- note(N_WARNING, "notify_host: failed to notify %s\n",
- inet_ntoa(lp->addr));
+ note(N_WARNING, "notify_host: failed to notify port %d\n",
+ ntohs(lp->port));
}
NL_TIMES(lp) -= 1;