Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Nov 1997 19:09:12 +1030
From:      Mike Smith <mike@smith.net.au>
To:        Amancio Hasty <hasty@rah.star-gate.com>
Cc:        Mike Smith <mike@smith.net.au>, current@freefall.FreeBSD.org
Subject:   Re: tcp/ip buglet ? 
Message-ID:  <199711250839.TAA01011@word.smith.net.au>
In-Reply-To: Your message of "Tue, 25 Nov 1997 00:32:43 -0800." <199711250832.AAA00315@rah.star-gate.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Per Mike's suggestion -- he asked to sprinkle with printfs the potential
> error returns in net and netinet .
> And the culprit is:
> 
> int
> in_pcbladdr(inp, nam, plocal_sin)
> 	register struct inpcb *inp;
> 	struct sockaddr *nam;
> 	struct sockaddr_in **plocal_sin;
> {
> 	struct in_ifaddr *ia;
> 	register struct sockaddr_in *sin = (struct sockaddr_in *)nam;
> 
> 	if (nam->sa_len != sizeof (*sin))
> 		return (EINVAL);
> 	if (sin->sin_family != AF_INET)
> 		return (EAFNOSUPPORT);
> 	if (sin->sin_port == 0) {
> 			  printf("in_pcbladdr  \n");
> 			  printf("addr %x \n", sin->sin_addr.s_addr);
> 		return (EADDRNOTAVAIL);
> 	}
> 
> The port and address field are 0.
> 
> The system call was a sendto with port 29710 and address 127.0.0.1.

This is pcbladdr, ie. local address (I think).  The bind() call was 
made with INADDR_ANY, ie. address 0, but a nonzero port address.  You
will probably want to back up and find out what's gone wrong with the
local port number.  

A hexdump of the first 16 bytes of the sin structure would also be 
educational; it's possible there's an alignment problem there.

bind() appears to be working correctly insofar as you say the server 
port is bound correctly to 29710 and shows up there using netstat...

mike





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