summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlon <lon>2000-10-24 14:31:29 +0000
committerlon <lon>2000-10-24 14:31:29 +0000
commit8d2c2fe749658654b3ffc6ff25daba6e9b27294f (patch)
tree2dd328e7dfc90515b270a63bdce6891d9c8a8fba
parentc7f54cc9a23167dea6bdc3e93834d070efa7e7e7 (diff)
downloadnfs-utils-8d2c2fe749658654b3ffc6ff25daba6e9b27294f.tar.gz
nfs-utils-8d2c2fe749658654b3ffc6ff25daba6e9b27294f.tar.xz
nfs-utils-8d2c2fe749658654b3ffc6ff25daba6e9b27294f.zip
Added some IP address paranoia when doing callbacks to local lockd.
-rw-r--r--utils/statd/rmtcall.c12
1 files changed, 11 insertions, 1 deletions
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);