X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fstatd%2Frmtcall.c;h=b70e5bb701e829a391ff6fda47abd10239fab4cb;hp=7745538a8f0b2a18ac511830d8142b0d5e2fb4b0;hb=b63400dcb05eee79666bade57558279fd15f0318;hpb=a5fdf1a4b7aea774332ec1fb85090cb640044585 diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c index 7745538..b70e5bb 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. */ @@ -29,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -295,13 +297,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 +315,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);