From 8d2c2fe749658654b3ffc6ff25daba6e9b27294f Mon Sep 17 00:00:00 2001 From: lon Date: Tue, 24 Oct 2000 14:31:29 +0000 Subject: [PATCH] Added some IP address paranoia when doing callbacks to local lockd. --- utils/statd/rmtcall.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c index 7745538..3d9e7cc 100644 --- a/utils/statd/rmtcall.c +++ b/utils/statd/rmtcall.c @@ -4,6 +4,7 @@ * Modified by H.J. Lu, 1998. * Modified by Lon Hohberger, Oct. 2000 * - Bugfix handling client responses. + * - Paranoia on NOTIFY_CALLBACK case * * NSM for Linux. */ @@ -295,13 +296,17 @@ process_entry(int sockfd, notify_list *lp) memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_port = lp->port; - sin.sin_addr = lp->addr; + /* LH - moved address into switch */ switch (NL_TYPE(lp)) { case NOTIFY_REBOOT: prog = SM_PROG; vers = SM_VERS; proc = SM_NOTIFY; + + /* Use source address for notify replies */ + sin.sin_addr = lp->addr; + func = (xdrproc_t) xdr_stat_chge; objp = &SM_stat_chge; break; @@ -309,6 +314,11 @@ process_entry(int sockfd, notify_list *lp) prog = NL_MY_PROG(lp); vers = NL_MY_VERS(lp); proc = NL_MY_PROC(lp); + + /* __FORCE__ loopback for callbacks to lockd ... */ + /* Just in case we somehow ignored it thus far */ + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + func = (xdrproc_t) xdr_status; objp = &new_status; new_status.mon_name = NL_MON_NAME(lp); -- 2.39.5