From owner-freebsd-current Tue Nov 25 00:43:50 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA26156 for current-outgoing; Tue, 25 Nov 1997 00:43:50 -0800 (PST) (envelope-from owner-freebsd-current) Received: from word.smith.net.au (vh1.gsoft.com.au [203.38.152.122]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id AAA26147 for ; Tue, 25 Nov 1997 00:43:45 -0800 (PST) (envelope-from mike@word.smith.net.au) Received: from word (localhost [127.0.0.1]) by word.smith.net.au (8.8.7/8.8.5) with ESMTP id TAA01011; Tue, 25 Nov 1997 19:09:13 +1030 (CST) Message-Id: <199711250839.TAA01011@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: Amancio Hasty cc: Mike Smith , current@freefall.FreeBSD.org Subject: Re: tcp/ip buglet ? In-reply-to: Your message of "Tue, 25 Nov 1997 00:32:43 -0800." <199711250832.AAA00315@rah.star-gate.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 25 Nov 1997 19:09:12 +1030 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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