From owner-freebsd-current Wed Jan 8 19:28:00 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id TAA22460 for current-outgoing; Wed, 8 Jan 1997 19:28:00 -0800 (PST) Received: from spinner.DIALix.COM (root@spinner.DIALix.COM [192.203.228.67]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id TAA22449 for ; Wed, 8 Jan 1997 19:27:50 -0800 (PST) Received: from spinner.DIALix.COM (peter@localhost.DIALix.oz.au [127.0.0.1]) by spinner.DIALix.COM (8.8.4/8.8.4) with ESMTP id LAA10608; Thu, 9 Jan 1997 11:27:13 +0800 (WST) Message-Id: <199701090327.LAA10608@spinner.DIALix.COM> To: davidn@blaze.net.au cc: grog@lemis.de, FreeBSD current users Subject: Re: What's happened to nfsd and mountd? In-reply-to: Your message of "Thu, 09 Jan 1997 13:27:30 +1100." Date: Thu, 09 Jan 1997 11:27:13 +0800 From: Peter Wemm Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk David Nugent wrote: > We're suffering the same problem here. ifconfig -a shows: [..] > The first interface is up and operational. Nothing funky with IP > aliases on this box. Another one (with nothing but loopback and > ethernet) which *does* have several IP aliases on ed0 is using > the exact same build, but mountd/nfsd load and work fine there. > > Regards, > David OK, time to run a quick test.. What do you guys get from this quick hack.. pwroot@spinner[11:04am]~-227# cc -o gma gma.c pwroot@spinner[11:04am]~-228# ./gma get_myaddress() returns 0 sin_family = 2 (AF_INET = 2) sin_len = 16 (16) sin_port = 111 sin_addr = 127.0.0.1 SIOCFIGCONF used 316 bytes of a buffer 1024 long pwroot@spinner[11:04am]~-229# cat gma.c #include #include #include #include #include #include #include main() { struct sockaddr_in mya; int r, s; char buf[BUFSIZ]; struct ifconf ifc; r = get_myaddress(&mya); printf("get_myaddress() returns %d\n", r); printf("sin_family = %d (AF_INET = %d)\n", mya.sin_family, AF_INET); printf("sin_len = %d (%d)\n", mya.sin_len, sizeof(mya)); printf("sin_port = %d\n", ntohs(mya.sin_port)); printf("sin_addr = %s\n", inet_ntoa(mya.sin_addr.s_addr)); s = socket(AF_INET, SOCK_DGRAM, 0); if (s < 0) err(1, "socket"); ifc.ifc_len = sizeof (buf); ifc.ifc_buf = buf; if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) err(1, "SIOCGIFCONF"); printf("SIOCFIGCONF used %d bytes of a buffer %d long\n", ifc.ifc_len, sizeof(buf)); } One of my systems nearby uses 992 bytes of the SIOCGIFCONF 1024 byte buffer (as used in get_myaddress). It would be interesting to know what happens if it is overflowing on the systems that are failing. Just to make things even more bizzare, the system that returns 992 bytes (struct ifreq = 32 bytes), which is 31 ifreq's, actually has 49 interfaces, and yet SIOCGIFCONF returned a "short" list with only 31 entries and no indication of error or overflow. (the actual number of slots of SIOCGIFCONF data comes from "netstat -in | grep -v Name | wc -l", don't forget that SIOCGIFCONF also returns AF_LINK entries) On my own system here, I have 5 interfaces, yet SIOCGIFCONF returns 9 ifreq structs. Garrett suggested redoing get_myaddress() to use sysctl(), which is starting to sound more appealing.. Something to try on the machines that are failing.. In lib/libc/rpc/ get_myaddress.c, change "char buf[BUFSIZ];" to something bigger, eg: "char buf[10240];" If you got about "992 used" for the test program above, make the change there too. Cheers, -Peter