From owner-freebsd-hackers Fri Mar 23 12:32:12 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from sdmail0.sd.bmarts.com (sdmail0.sd.bmarts.com [209.247.77.155]) by hub.freebsd.org (Postfix) with ESMTP id 490D637B718 for ; Fri, 23 Mar 2001 12:32:08 -0800 (PST) (envelope-from gordont@bluemtn.net) Received: from localhost (gordont@localhost) by sdmail0.sd.bmarts.com (8.11.3/8.11.2/BMA1.1) with ESMTP id f2NKVaL67317; Fri, 23 Mar 2001 12:31:36 -0800 (PST) Date: Fri, 23 Mar 2001 12:31:36 -0800 (PST) From: Gordon Tetlow X-X-Sender: To: Harti Brandt Cc: Subject: Re: Problems with new RPC In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG If you haven't, please please please, send-pr(1) this so the right people get a look at this. Last thing we need is a broken ypbind (not that I use it). More down below. On Fri, 23 Mar 2001, Harti Brandt wrote: > the recent update to RPC causes ypbind to break. The problem is, that > /usr/src/usr.sbin/ypbind/yp_ping.c mirrors some code from the RPC library, > including the internal structure used for the CLIENT structure. The > version in libc uses a struct sockaddr_storage (128 bytes) whereas yp_ping > has a struct sockaddr_in (something lesser). The libc version also > includes a member just at the end of the structure (struct pollfd) that > the ypbind version does not have. > Because the XDR buffers are allocate directly behind struct CLIENT, this > makes the pointers into the buffer wrong. This causes the ypbind child to > dump core, which in turn causes the parent to create a new child, which > dumps core, causing the parent to create a new child, which dumps core ... > > A simple fix (rather a workaround is): > > Index: yp_ping.c > =================================================================== > RCS file: /usr/ncvs/src/usr.sbin/ypbind/yp_ping.c,v > retrieving revision 1.8 > diff -u -r1.8 yp_ping.c > --- yp_ping.c 2001/03/19 12:50:12 1.8 > +++ yp_ping.c 2001/03/20 13:46:24 > @@ -93,6 +93,7 @@ > #include > #include > #include > +#include > #include > #include "yp_ping.h" > > @@ -126,7 +127,7 @@ > struct cu_data { > int cu_sock; > bool_t cu_closeit; > - struct sockaddr_in cu_raddr; > + struct sockaddr_storage cu_raddr; > int cu_rlen; > struct timeval cu_wait; > struct timeval cu_total; > @@ -136,6 +137,7 @@ > u_int cu_sendsz; > char *cu_outbuf; > u_int cu_recvsz; > + struct pollfd cu_pollfd; > char cu_inbuf[1]; > }; > > Another problem which started at the day the RPC stuff was committed are > error messages of the form > > yp_match: clnt_call: RPC: Program unavailable > > spit out from various programs, among them pine, tcpdump, tcptrace. > How can I fix this (or at least find out, what's the problem)? If I had to take a wild stab, if ypbind isn't working right, I suspect that tcpdump is doing RPC lookups on traffic going by. The rest? ah who knows. -gordon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message