sunrpc binary incompatibility with glibc 2.1.x

Jakub Jelinek jakub@redhat.com
Wed May 24 06:46:00 GMT 2000


Hi!

Changing type of xp_raddr field in SVCXPRT (rpc/svc.h) from sockaddr_in to
sockaddr_storage breaks binary compatibility on 64bit hosts
(sockaddr_storage is aligned to 64 bits while sockaddr_in to 32bits only, so
there is 4 bytes padding before sockaddr_storage while it is not present for
sockaddr_in).
Any ideas what to do with it?
Versioning almost the whole sunrpc/ does not seem like a good idea to me, so
perhaps cannot we have (on 64bit arches only):

  int           xp_addrlen;      /* length of remote address */
  struct sockaddr_in xp_raddr;      /* remote address */
  struct sockaddr_storage xp_rnaddr; /* new remote address */
  struct opaque_auth xp_verf;    /* raw response verifier */
  caddr_t               xp_p1;           /* private */
  caddr_t               xp_p2;           /* private */
  int		xp_p3;		/* private */
  char          xp_pad [256];   /* padding, internal use */

where svc_getcaller would be:

#define svc_getcaller(x)		\
({ SVCXPRT *__svcxprt = (SVCXPRT *)(x);	\
   __svcxprt->xp_p3 ?			\
	(void *)&__svcxprt->xp_rnaddr :	\
	(void *)&__svcxprt->xp_raddr;	\
})

	Jakub


More information about the Libc-hacker mailing list