--- amfs_auto.c.pre Fri Mar 7 12:53:16 2003 +++ amfs_auto.c Fri Mar 7 13:13:04 2003 @@ -51,6 +51,7 @@ #endif /* HAVE_CONFIG_H */ #include #include +#include "svc_udp_internals.h" /**************************************************************************** *** MACROS *** @@ -1257,6 +1258,9 @@ fprintf(stderr, "COPIED nfs_program_2_transp %p to new_mp %p, am_mapno %d, am_gen %d\n", nfs_program_2_transp, new_mp, new_mp->am_mapno, new_mp->am_gen); new_mp->am_transp = (SVCXPRT *) xmalloc(sizeof(SVCXPRT)); *(new_mp->am_transp) = *nfs_program_2_transp; + su_data(new_mp->am_transp) = xmalloc(sizeof (struct svcudp_data)); + bcopy(su_data(nfs_program_2_transp), su_data(new_mp->am_transp), sizeof (struct svcudp_data)); + rpc_buffer(new_mp->am_transp) = xmalloc(su_data(new_mp->am_transp)->su_iosz); } if (error && (new_mp->am_mnt->mf_ops == &amfs_error_ops)) new_mp->am_error = error; --- nfs_subr.c.dist Fri Mar 7 13:18:03 2003 +++ nfs_subr.c Fri Mar 7 13:17:53 2003 @@ -47,6 +47,7 @@ #endif /* HAVE_CONFIG_H */ #include #include +#include "svc_udp_internals.h" /* * Convert from UN*X to NFS error code. @@ -283,6 +284,8 @@ /* * Free up transp. It's only used for one reply. */ + free(su_data(transp)); + free(rpc_buffer(transp)); XFREE(transp); mp->am_transp = NULL; #ifdef DEBUG --- map.c.dist Tue Mar 4 21:08:36 2003 +++ map.c Fri Mar 7 13:09:17 2003 @@ -47,6 +47,7 @@ #endif /* HAVE_CONFIG_H */ #include #include +#include "svc_udp_internals.h" #define smallest_t(t1, t2) (t1 != NEVER ? (t2 != NEVER ? (t1 < t2 ? t1 : t2) : t1) : t2) #define IGNORE_FLAGS (MFF_MOUNTING|MFF_UNMOUNTING|MFF_RESTART) @@ -346,8 +347,11 @@ XFREE(mp->am_path); if (mp->am_pref) XFREE(mp->am_pref); - if (mp->am_transp) + if (mp->am_transp) { + free(su_data(mp->am_transp)); + free(rpc_buffer(mp->am_transp)); XFREE(mp->am_transp); + } if (mp->am_mnt) free_mntfs(mp->am_mnt); --- /dev/null Fri Mar 7 03:01:01 2003 +++ svc_udp_internals.h Fri Mar 7 12:57:00 2003 @@ -0,0 +1,9 @@ +struct svcudp_data { + u_int su_iosz; /* byte size of send.recv buffer */ + u_long su_xid; /* transaction id */ + XDR su_xdrs; /* XDR handle */ + char su_verfbody[MAX_AUTH_BYTES]; /* verifier body */ + char * su_cache; /* cached data, NULL if no cache */ +}; +#define su_data(xprt) ((struct svcudp_data *)(xprt->xp_p2)) +#define rpc_buffer(xprt) ((xprt)->xp_p1)