From owner-freebsd-current@FreeBSD.ORG Sun May 21 05:53:36 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E84716A44D; Sun, 21 May 2006 05:53:36 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail21.syd.optusnet.com.au (mail21.syd.optusnet.com.au [211.29.133.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58B1343D45; Sun, 21 May 2006 05:53:35 +0000 (GMT) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail21.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k4L5rXLe030901 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 21 May 2006 15:53:33 +1000 Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.6/8.13.6) with ESMTP id k4L5rW1a017735; Sun, 21 May 2006 15:53:32 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.6/8.13.6/Submit) id k4L5rW2N017734; Sun, 21 May 2006 15:53:32 +1000 (EST) (envelope-from peter) Date: Sun, 21 May 2006 15:53:32 +1000 From: Peter Jeremy To: David Xu Message-ID: <20060521055332.GE1587@turion.vk2pj.dyndns.org> References: <200605211204.10259.davidxu@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200605211204.10259.davidxu@freebsd.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.11 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 05:53:36 -0000 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? -- Peter Jeremy