From bg@bg.sics.se  Thu Apr  5 12:56:05 2001
Return-Path: <bg@bg.sics.se>
Received: from bg.sics.se (bg.sics.se [193.10.66.124])
	by hub.freebsd.org (Postfix) with ESMTP id 1028737B424
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  5 Apr 2001 12:56:05 -0700 (PDT)
	(envelope-from bg@bg.sics.se)
Received: (from bg@localhost)
	by bg.sics.se (8.11.1/8.11.1) id f35Ju4i06084;
	Thu, 5 Apr 2001 21:56:04 +0200 (CEST)
	(envelope-from bg)
Message-Id: <200104051956.f35Ju4i06084@bg.sics.se>
Date: Thu, 5 Apr 2001 21:56:04 +0200 (CEST)
From: bg@sics.se
Reply-To: bg@sics.se
To: FreeBSD-gnats-submit@freebsd.org
Cc: bg@sics.se
Subject: rpc.statd won't accept SM_NOTIFY call
X-Send-Pr-Version: 3.2

>Number:         26373
>Category:       misc
>Synopsis:       Rpc.statd implements the SM_NOTIFY call but does not accept it
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 05 13:00:01 PDT 2001
>Closed-Date:    Thu Apr 11 10:09:10 PDT 2002
>Last-Modified:  Thu Apr 11 10:09:10 PDT 2002
>Originator:     Bjoern Groenvall
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
SICS
>Environment:

FreeBSD NFS servers.

>Description:

Rpc.statd implements the SM_NOTIFY call but because of an outdated
sm_inter.x file the daemon will not accept the call. Reception of the
call is made by a routine generated from sm_inter.x. by rpcgen.

>How-To-Repeat:

Make a SunOS 5.x box call statd on your FreeBSD machine.

>Fix:

First sm_inter.x must be changed to include procedure #6, this also
requires a type stat_chge.

Remove the definition of stat_chge that was kludged into statd.h.

--- sm_inter.x.ORIG	Sat Aug 28 01:45:11 1999
+++ sm_inter.x	Mon Mar 19 16:13:11 2001
@@ -63,6 +63,8 @@
 
 		void					 SM_SIMU_CRASH(void) = 5;
 
+		void					 SM_NOTIFY(struct stat_chge) = 6;
+
 	} = 1;
 } = 100024;
 
@@ -119,4 +121,9 @@
 	string mon_name<SM_MAXSTRLEN>;
 	int state;
 	opaque priv[16];		/* stored private information */
+};
+
+struct stat_chge {
+	string mon_name<SM_MAXSTRLEN>;
+	int state;
 };
--- statd.h.ORIG	Mon Apr  1 07:36:06 1996
+++ statd.h	Mon Mar 19 16:16:40 2001
@@ -35,20 +35,6 @@
 
 #include "sm_inter.h"
 
-/* These pieces are missing from the distributed sm_inter.x, which	*/
-/* omits the SM_NOTIFY procedure used between cooperating rpc.statd's	*/
-
-#define SM_NOTIFY ((u_long)6)
-extern void *sm_notify_1();
- 
-struct stat_chge
-{
-  char *mon_name;
-  int state;
-};
-typedef struct stat_chge stat_chge;
-bool_t xdr_stat_chge();
-
 /* ------------------------------------------------------------------------- */
 /*
   Data structures for recording monitored hosts
>Release-Note:
>Audit-Trail:

From: Dan Nelson <dnelson@allantgroup.com>
To: freebsd-gnats-submit@FreeBSD.org, bg@sics.se
Cc:  
Subject: Re: misc/26373: Rpc.statd implements the SM_NOTIFY call but does not accept it
Date: Wed, 3 Apr 2002 14:01:50 -0600

 Here is another patch that more closely follows what was already
 committed to 5.*:
 
 Index: include/rpcsvc/sm_inter.x
 ===================================================================
 RCS file: /home/ncvs/src/include/rpcsvc/sm_inter.x,v
 retrieving revision 1.8
 diff -u -r1.8 sm_inter.x
 --- include/rpcsvc/sm_inter.x	27 Aug 1999 23:45:11 -0000	1.8
 +++ include/rpcsvc/sm_inter.x	3 Apr 2002 19:06:02 -0000
 @@ -62,6 +62,7 @@
  		struct sm_stat				 SM_UNMON_ALL(struct my_id) = 4;
  
  		void					 SM_SIMU_CRASH(void) = 5;
 +		void					 SM_NOTIFY(struct stat_chge) = 6;
  
  	} = 1;
  } = 100024;
 @@ -90,6 +91,10 @@
  	opaque priv[16]; 		/* private information to store at monitor for requesting process */
  };
  
 +struct stat_chge {
 +	string  mon_name<SM_MAXSTRLEN>;         /* name of the site that had the state change */
 +	int state;
 +};
  
  /*
   * state # of status monitor monitonically increases each time
 @@ -101,13 +106,13 @@
  	int state;		/* state # of status monitor */
  };
  
 -enum res {
 +enum sm_res {
  	stat_succ = 0,		/* status monitor agrees to monitor */
  	stat_fail = 1		/* status monitor cannot monitor */
  };
  
  struct sm_stat_res {
 -	res res_stat;
 +	sm_res res_stat;
  	int state;
  };
  
 @@ -115,7 +120,7 @@
   * structure of the status message sent back by the status monitor
   * when monitor site status changes
   */
 -struct status {
 +struct sm_status {
  	string mon_name<SM_MAXSTRLEN>;
  	int state;
  	opaque priv[16];		/* stored private information */
 Index: usr.sbin/rpc.statd/procs.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.sbin/rpc.statd/procs.c,v
 retrieving revision 1.4
 diff -u -r1.4 procs.c
 --- usr.sbin/rpc.statd/procs.c	28 Aug 1999 01:19:37 -0000	1.4
 +++ usr.sbin/rpc.statd/procs.c	3 Apr 2002 19:07:51 -0000
 @@ -301,7 +301,7 @@
    struct timeval timeout = { 20, 0 };	/* 20 secs timeout		*/
    CLIENT *cli;
    static char dummy; 
 -  status tx_arg;		/* arg sent to callback procedure	*/
 +  sm_status tx_arg;		/* arg sent to callback procedure	*/
    MonList *lp;
    HostInfo *hp;
    pid_t pid;
 @@ -340,7 +340,7 @@
      }
      else
      {
 -      if (clnt_call(cli, lp->notifyProc, xdr_status, &tx_arg, xdr_void, &dummy,
 +      if (clnt_call(cli, lp->notifyProc, xdr_sm_status, &tx_arg, xdr_void, &dummy,
          timeout) != RPC_SUCCESS)
        {
          syslog(LOG_ERR, "Failed to call rpc.statd client at host %s",
 Index: usr.sbin/rpc.statd/statd.h
 ===================================================================
 RCS file: /home/ncvs/src/usr.sbin/rpc.statd/statd.h,v
 retrieving revision 1.2
 diff -u -r1.2 statd.h
 --- usr.sbin/rpc.statd/statd.h	1 Apr 1996 05:36:06 -0000	1.2
 +++ usr.sbin/rpc.statd/statd.h	3 Apr 2002 19:56:35 -0000
 @@ -35,20 +35,6 @@
  
  #include "sm_inter.h"
  
 -/* These pieces are missing from the distributed sm_inter.x, which	*/
 -/* omits the SM_NOTIFY procedure used between cooperating rpc.statd's	*/
 -
 -#define SM_NOTIFY ((u_long)6)
 -extern void *sm_notify_1();
 - 
 -struct stat_chge
 -{
 -  char *mon_name;
 -  int state;
 -};
 -typedef struct stat_chge stat_chge;
 -bool_t xdr_stat_chge();
 -
  /* ------------------------------------------------------------------------- */
  /*
    Data structures for recording monitored hosts
 
 
 
 -- 
 	Dan Nelson
 	dnelson@allantgroup.com
State-Changed-From-To: open->closed 
State-Changed-By: alfred 
State-Changed-When: Thu Apr 11 10:08:56 PDT 2002 
State-Changed-Why:  
patch has been committed, thank you very much. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=26373 
>Unformatted:
