From owner-freebsd-net Fri Sep 14 16:11:48 2001 Delivered-To: freebsd-net@freebsd.org Received: from w250.z064001178.sjc-ca.dsl.cnc.net (w250.z064001178.sjc-ca.dsl.cnc.net [64.1.178.250]) by hub.freebsd.org (Postfix) with SMTP id 5820037B407 for ; Fri, 14 Sep 2001 16:11:46 -0700 (PDT) Received: (qmail 51561 invoked by uid 1000); 14 Sep 2001 23:12:08 -0000 Date: Fri, 14 Sep 2001 16:11:46 -0700 From: Jos Backus To: freebsd-net@FreeBSD.ORG Subject: Re: How does getsockname() work? Message-ID: <20010914161146.B49323@lizzy.bugworks.com> Reply-To: Jos Backus Mail-Followup-To: freebsd-net@FreeBSD.ORG References: <20010914122357.A49323@lizzy.bugworks.com> <20010914165555.A150@tp.databus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010914165555.A150@tp.databus.com> User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, Sep 14, 2001 at 04:55:33PM -0400, Barney Wolff wrote: > You're using htons on an int. Try not doing that. > Barney Wolff Oops. Then that's a bug in samplicator-1.2.1, from which I took the code. But after changing fport to an u_short it still does not work. > On Fri, Sep 14, 2001 at 12:23:57PM -0700, Jos Backus wrote: > > struct sock { > > int fport; > > int fsockfd; > > long sockbuflen; > > }; > > > > static int > > init_sock(ctx) > > struct sock *ctx; > > { > > struct sockaddr_in local_address; > > > > bzero(&local_address, sizeof local_address); > > local_address.sin_family = AF_INET; > > local_address.sin_addr.s_addr = htonl(INADDR_ANY); > > local_address.sin_port = htons(ctx->fport); Thanks, -- Jos Backus _/ _/_/_/ Santa Clara, CA _/ _/ _/ _/ _/_/_/ _/ _/ _/ _/ josb@cncdsl.com _/_/ _/_/_/ use Std::Disclaimer; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message