From owner-freebsd-current@FreeBSD.ORG Sun May 21 06:00:41 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from localhost.my.domain (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id D3AD716A426; Sun, 21 May 2006 06:00:40 +0000 (UTC) (envelope-from davidxu@freebsd.org) From: David Xu To: Peter Jeremy Date: Sun, 21 May 2006 14:00:30 +0800 User-Agent: KMail/1.8.2 References: <200605211204.10259.davidxu@freebsd.org> <20060521055332.GE1587@turion.vk2pj.dyndns.org> In-Reply-To: <20060521055332.GE1587@turion.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605211400.30163.davidxu@freebsd.org> Cc: current@freebsd.org Subject: Re: couldn't bind to local address X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 May 2006 06:00:41 -0000 On Sunday 21 May 2006 13:53, Peter Jeremy wrote: > On Sun, 2006-May-21 12:04:10 +0800, David Xu wrote: > > struct sockaddr_in addr; > > ... > > > addr.sin_family = AF_INET; > > addr.sin_port = htons(9000); > > addr.sin_addr.s_addr = inet_addr("127.0.0.1"); > > It's a good idea to assign sin_len as well. And, ideally, you would > bzero the structure first. > > On Sun, 2006-May-21 12:34:30 +0800, David Xu wrote: > >I am trying it on -CURRENT, and found lo0 does not have an address, what > > can cause this ? > > There should be an ifconfig_lo0 in /etc/defaults/rc.conf which causes lo0 > to be initialised via /etc/rc.d/netif and /etc/network.subr. Do you get > any errors during boot? in fact, finally I found sysinstall only put nve0 in variable network_interfaces, this causes lo0 does not have an address assigned. David Xu