This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] svcudp_recv


On Mon, Oct 02, 2000 at 12:13:38AM -0700, Ulrich Drepper wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
> 
> > - change cmsghdr definition at least on sparc64 (maybe ia64, mips64, k8) to
> > socklen_t and kill all the ugly translation.
> 
> I like this one.

Sure, so do I, will mail netdev, AK and Alexey in a minute, that decision is
not up to me (but it would be very good to finalize it before glibc 2.2).
If DaveM+AK+Alexey decide it should stay size_t, I'll code the non-in-situ
patch for recvmsg (have studied that code a little bit and it is doable),
otherwise they just have to decide about ia64 (it would be binary
incompatible change, so the question is whether the userland is still open
to such changes or no longer).

No matter what, I think it does not hurt if we make 32bit sparc glibc work even with
older kernels.
xp_pad is 256 bytes long and is not used at all after the
sizeof(struct iovec) + sizeof(struct msghdr) + sizeof(struct cmsghdr) +
sizeof(struct in_pktinfo) mark, so the patch below does not slow anything
down nor looks like a hack to me.

2000-10-02  Jakub Jelinek  <jakub@redhat.com>

	* sunrpc/svc_udp.c (svcudp_recv): Set msg_controllen to all
	remaining xp_pad space.

--- libc/sunrpc/svc_udp.c.jj	Tue Mar 14 08:30:55 2000
+++ libc/sunrpc/svc_udp.c	Mon Oct  2 10:49:04 2000
@@ -245,8 +245,8 @@ again:
       mesgp->msg_namelen = len;
       mesgp->msg_control = &xprt->xp_pad [sizeof (struct iovec)
 					  + sizeof (struct msghdr)];
-      mesgp->msg_controllen = sizeof(struct cmsghdr)
-			      + sizeof (struct in_pktinfo);
+      mesgp->msg_controllen = sizeof(xprt->xp_pad)
+			      - sizeof (struct iovec) - sizeof (struct msghdr);
       rlen = recvmsg (xprt->xp_sock, mesgp, 0);
       if (rlen >= 0)
 	len = mesgp->msg_namelen;


	Jakub

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]