From d148ed257ab179a6a408bc1668e2effb447726bd Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 27 Feb 2003 08:01:47 +0000 Subject: Update. 2003-02-27 Ulrich Drepper * sunrpc/svc_udp.c (svcudp_recv): Remove all control messages except the PKTINFO. Reset interface in PKTINFO. * elf/elf.h: Add new R_PPC64_* relocs for TLS. * elf/tls-macros.h [__powerpc64__] (TLS_LE, TLS_IE, TLS_LD, TLS_GD): Define. * sysdeps/powerpc/elf/libc-start.c (__libc_start_main): --- sunrpc/svc_udp.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'sunrpc') diff --git a/sunrpc/svc_udp.c b/sunrpc/svc_udp.c index 0410e9c008..cb1d70558e 100644 --- a/sunrpc/svc_udp.c +++ b/sunrpc/svc_udp.c @@ -258,7 +258,29 @@ again: - sizeof (struct iovec) - sizeof (struct msghdr); rlen = __recvmsg (xprt->xp_sock, mesgp, 0); if (rlen >= 0) - len = mesgp->msg_namelen; + { + struct cmsghdr *cmsg; + len = mesgp->msg_namelen; + cmsg = CMSG_FIRSTHDR (mesgp); + if (cmsg == NULL + || CMSG_NXTHDR (mesgp, cmsg) != NULL + || cmsg->cmsg_level != SOL_IP + || cmsg->cmsg_type != IP_PKTINFO + || cmsg->cmsg_len < (sizeof (struct cmsghdr) + + sizeof (struct in_pktinfo))) + { + /* Not a simple IP_PKTINFO, ignore it. */ + mesgp->msg_control = NULL; + mesgp->msg_controllen = 0; + } + else + { + /* It was a simple IP_PKTIFO as we expected, discard the + interface field. */ + struct in_pktinfo *pkti = CMSG_DATA (cmsg); + pkti->ipi_ifindex = 0; + } + } } else #endif -- cgit 1.4.1