Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jan 1997 16:20:47 +0100 (MET)
From:      grog@lemis.de
To:        peter@spinner.DIALix.COM (Peter Wemm)
Cc:        FreeBSD-current@FreeBSD.ORG (FreeBSD current users)
Subject:   Re: What's happened to nfsd and mountd?
Message-ID:  <199701091520.QAA03172@freebie.lemis.de>
In-Reply-To: <199701091502.XAA13553@spinner.DIALix.COM> from Peter Wemm at "Jan 9, 97 11:02:49 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Wemm writes:
> Greg Lehey wrote:
>>  A pointer to the problem, by the look of it:
>>
>>  === grog@freebie (/dev/ttypa) ~/src 3 -> gma
>>  get_myaddress() returns 0
>>  sin_family = 0 (AF_INET = 2)
>>  sin_len = 3 (16)
>>  sin_port = 0
>>  sin_addr = 0.32.0.0
>>  SIOCFIGCONF used 1008 bytes of a buffer 1024 long
>
> YIKES!  SIOCGIFCONF might be screwing up by the look of it.  Either that
> or you
> have records being returned that are not sizeof(ifreq) in length and the
> code that is supposed to track these isn't working.  There's 16 spare
> bytes coming from somewhere..
>
> I think get_myaddress() has failed, and didn't return a failure code, so
> the uninitialised data is being used..

No, I've got further than that.  There's a bug in get_myaddress, line 91:

                if ((ifreq.ifr_flags & IFF_UP) &&
                    ifr->ifr_addr.sa_family == AF_INET &&
                    (loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK))) {  <--- here
			*addr = *((struct sockaddr_in *)&ifr->ifr_addr);
			addr->sin_port = htons(PMAPPORT);
			gotit = 1;
			break;
		}

This means that it can't find anything in the first pass (where
loopback is 0), and it always takes the loopback interface in the
second pass.  I've changed this to:

		if ((ifreq.ifr_flags & IFF_UP) &&
		    ifr->ifr_addr.sa_family == AF_INET &&
		    (loopback == 1 || ! (ifreq.ifr_flags & IFF_LOOPBACK))) {


Now gma returns:

=== grog@freebie (/dev/ttyp5) ~/src 16 -> gma
get_myaddress() returns 0
sin_family = 2 (AF_INET = 2)
sin_len = 16 (16)
sin_port = 111
sin_addr = 192.109.197.137
SIOCFIGCONF used 1008 bytes of a buffer 1024 long

Unfortunately, mountd still fails (and draws portmap in for sympathy)
with a message which completely baffles me:

Jan  9 12:08:28 freebie portmap[754]: connect from 127.0.0.1 to unset(mountd): request from non-local host
Jan  9 12:08:39 freebie portmap[759]: connect from 127.0.0.1 to unset(mountd): request from non-local host
Jan  9 12:08:39 freebie mountd[749]: Can't register mount
Jan  9 12:08:39 freebie portmap[760]: connect from 127.0.0.1 to set(mountd): request from non-local host
Jan  9 12:10:29 freebie portmap[803]: connect from 127.0.0.1 to unset(mountd): request from non-local host
Jan  9 12:10:29 freebie portmap[804]: connect from 127.0.0.1 to unset(mountd): request from non-local host
Jan  9 12:10:29 freebie mountd[802]: Can't register mount
Jan  9 12:10:29 freebie portmap[805]: connect from 127.0.0.1 to set(mountd): request from non-local host

I've established (with gdb and mountd -d) that it does (now) find the
correct interface (which should be obvious form the sin_addr reported
by gma), but these messages look like they should have come from the
old version, not from this one.  Unfortunately, I'm off on a business
trip for 2 weeks tomorrow, and I don't have time to follow through any
further.

>>>  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.
>>
>>  I'd guess it's probably the wrong family.
>
> Yes. get_myaddress() is returning a family of 0 (AF_UNSPEC), rather than
> AF_INET, so it's no real suprise that it can't send to that address over a
> UDP socket.
>
> Can you give me the result of 'netstat -in' please?  I'm curious to see if
> you have large <Link> entries or something on the isdn interfaces.

OK, here goes, though again I don't think this is the problem.

=== root@freebie (/dev/ttyp6) /home/grog 18 -> netstat -in
Name  Mtu   Network       Address            Ipkts Ierrs    Opkts Oerrs  Coll
lp0*  1500  <Link>                               0     0        0     0     0
ep0   1500  <Link>      00.a0.24.37.0d.2b    23066     0    17860     1     0
ep0   1500  192.109.197   192.109.197.137    23066     0    17860     1     0
ipi0  1500  <Link>                               0     0        0     0     0
ipi0  1500  192.109.197.1 192.109.197.137        0     0        0     0     0
ipi1  1500  <Link>                             166     0      208     7     0
ipi1  1500  192.109.197   192.109.197.137      166     0      208     7     0
ipi2  1500  <Link>                               0     0        0     0     0
ipi2  1500  192.109.197.1 192.109.197.137        0     0        0     0     0
ipi3  1500  <Link>                               0     0        0     0     0
ipi3  1500  192.109.197   192.109.197.37         0     0        0     0     0
ipi4  1500  <Link>                               0     0        0     0     0
ipi4  1500  192.109.197   192.109.197.148        0     0        0     0     0
ipi5  1500  <Link>                               0     0        0     0     0
ipi5  1500  192.109.197.1 192.109.197.137        0     0        0     0     0
ipi6  1500  <Link>                               0     0        0     0     0
ipi6  1500  192.109.197   192.109.197.137        0     0        0     0     0
ipi7* 1500  <Link>                               0     0        0     0     0
ipi8* 1500  <Link>                               0     0        0     0     0
ipi9  1500  <Link>                             413     0      514     0     0
ipi9  1500  194.97.201    194.97.201.66        413     0      514     0     0
ipi10 1500  <Link>                               0     0        0     0     0
ipi11 1500  <Link>                               0     0        0     0     0
ipi12 1500  <Link>                               0     0        0     0     0
ipi13 1500  <Link>                               0     0        0     0     0
ipi14 1500  <Link>                               0     0        0     0     0
ipi15 1500  <Link>                               0     0        0     0     0
tun0* 1500  <Link>                               0     0        0     0     0
sl0*  552   <Link>                               0     0        0     0     0
ppp0* 1500  <Link>                               0     0        0     0     0
ppp1* 1500  <Link>                               0     0        0     0     0
lo0   16384 <Link>                            1465     0     1465     0     0
lo0   16384 127           127.0.0.1           1465     0     1465     0     0

I've changed my name server config, and at some time in the next 24
hours my lowest MX will point to freefall.  When that happens, I may
not get any messages for up to 48 hours.  Could you please copy
grog@freebie.lemis.de on any message you send before Friday the 10th,
1000 UTC?

Thanks in advance
Greg



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701091520.QAA03172>