Subject: Patch for rsvpd.rel4.2a4-1 fixes Linux compilation

From: Craig Rodrigues <[email-masked]>
Date: Thu, 10 May 2001 23:57:48 -0400

Hello,

I would like to submit the following patch for
rsvpd.rel4.2a4-1.  This patch fixes compilation
problems in the rsvpd.rel4.2a4-1 release of
ISI's rsvpd.
Without this patch, I could not compile
rsvpd.rel4.2a4-1 under Redhat Linux 6.2.

With this patch, I successfully compiled
rsvpd.rel4.2a4-1.  I also verified the correct
functioning of the patched rsvpd software in my
test lab which has Cisco 2500 RSVP enabled routers.

Would the maintainers of ISI rsvpd like to
incorporate my patch into their main 
software distribution?

I believe it would benefit the user community
of rsvpd, and those doing research in the
areas of RSVP and QoS networking.

Thank you.
-- 
Craig Rodrigues        Distributed Systems and Logistics, Office 6/304
[email-masked]       BBN Technologies
(617) 873-4725         Cambridge, MA
--- rel4.2a4/rsvpd/rsvp_trans.c.orig	Thu Feb  8 20:08:38 2001
+++ rel4.2a4/rsvpd/rsvp_trans.c	Thu Feb  8 20:08:51 2001
@@ -153,12 +153,6 @@
 #endif	/* sun */
 
 #ifdef	linux
-struct in_pktinfo
-{
-	int		ipi_ifindex;
-	struct in_addr	ipi_spec_dst;
-	struct in_addr	ipi_addr;
-};
 
 #define	uh_sport source
 #define	uh_dport dest
--- rel4.2a4/rsvpd/rsvp_key.c.orig	Thu Feb  8 20:14:40 2001
+++ rel4.2a4/rsvpd/rsvp_key.c	Thu Feb  8 20:15:53 2001
@@ -232,17 +232,21 @@
       /*	Check that recomputed digest matches what arrived.
        */
       if (!(memcmp(received_digest, computed_digest, MD5_LENG)))
+      {
 	if(check_seqno(&integrity, kap))     /* Valid sequence number    */
 	  break;
 	else
 	  return PKT_ERR_REPLAY;
+      }
     }
 
   if (!kap)
+  {
     if (i == 0)
       return PKT_ERR_NOINTASS;	             /* No matching key          */
     else
       return PKT_ERR_INTEGRITY;              /* No satisfactory key      */
+  }
 
   return 0;                                /* OK                         */
 }
@@ -452,12 +456,14 @@
 
   /* Previous field not invalid */
   if (!((old[0] == 0xffffffff) && (old[1] == 0xffffffff)))
+  {
     if (LT(new[0], old[0]) && ((old[0] - new[0]) < UINT_MAX/2))
       return 0;
     else if ((new[0] == old[0]) && (LT(new[1], old[1])))
       return 0;
     else if (LT(old[0], new[0]) && ((new[0] - old[0]) > UINT_MAX/2))
       return 0;
+  }
 
   /* Valid sequence number, update stored value */
   old[0] =  new[0];
--- rel4.2a4/rsvpd/rapi_lib.c.orig	Thu Feb  8 20:11:01 2001
+++ rel4.2a4/rsvpd/rapi_lib.c	Thu Feb  8 20:11:16 2001
@@ -1420,7 +1420,6 @@
 static char *
 copy_tspec_i2d(rapi_tspec_t * i_spec, API_TSpec * d_spec, char *endp)
 	{
-	int printf();
 	char *next;
 
 	if ((char *)d_spec + sizeof(rapi_tspec_t) > endp) {
--- rel4.2a4/rsvpd/rsvp_socks.c.orig	Thu Feb  8 20:11:39 2001
+++ rel4.2a4/rsvpd/rsvp_socks.c	Thu Feb  8 20:12:40 2001
@@ -1283,8 +1283,13 @@
  *
  */
 
+#ifndef MSG_TRUNC
 #define MSG_TRUNC	0x20
+#endif /* MSG_TRUNC */
+
+#ifndef MSG_DONTWAIT
 #define MSG_DONTWAIT	0x40	/* Nonblocking io		 */
+#endif /* MSG_DONTWAIT */
 
 int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
 {
--- rel4.2a4/rsvpd/rsrr_unicast.c.orig	Thu Feb  8 20:13:16 2001
+++ rel4.2a4/rsvpd/rsrr_unicast.c	Thu Feb  8 20:13:52 2001
@@ -692,8 +692,13 @@
 #define R_STALETIME	15
 #define R_LOAD		30
 
+#ifndef MSG_TRUNC
 #define MSG_TRUNC	0x20
+#endif /* MSG_TRUNC */
+
+#ifndef MSG_DONTWAIT
 #define MSG_DONTWAIT	0x40	/* Nonblocking io		 */
+#endif /* MSG_DONTWAIT */
 
 static struct rtnl_handle rt_nl;
 static const __u32 zerokey[KEYLEN];
--- rel4.2a4/apitools/scrapi.c.orig	Thu Feb  8 20:27:58 2001
+++ rel4.2a4/apitools/scrapi.c	Thu Feb  8 20:29:31 2001
@@ -11,6 +11,8 @@
 #include <strings.h>
 #include <limits.h>
 #include <unistd.h>
+#include <string.h>
+#include <sys/ioctl.h>
 #include <rapi_err.h>
 
 /*
--- rel4.2a4/apitools/rtap_main.c.orig	Thu Feb  8 20:35:02 2001
+++ rel4.2a4/apitools/rtap_main.c	Thu Feb  8 20:36:49 2001
@@ -41,9 +41,9 @@
 /*
  *	External declarations
  */
-int	Do_Command(char *, FILE *);
-void	rtap_cmds_init();
-char	*rapi_errlist[];
+extern int	Do_Command(char *, FILE *);
+extern void	rtap_cmds_init();
+extern char	*rapi_errlist[];
 
 /*
  * Forward Declarations