Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Sep 2001 16:11:46 -0700
From:      Jos Backus <josb@cncdsl.com>
To:        freebsd-net@FreeBSD.ORG
Subject:   Re: How does getsockname() work?
Message-ID:  <20010914161146.B49323@lizzy.bugworks.com>
In-Reply-To: <20010914165555.A150@tp.databus.com>
References:  <20010914122357.A49323@lizzy.bugworks.com> <20010914165555.A150@tp.databus.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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