Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Nov 1997 22:00:10 -0500
From:      Feiyi Wang <fwang2@eos.ncsu.edu>
To:        Archie Cobbs <archie@whistle.com>
Cc:        questions@FreeBSD.ORG, brian@awfulhak.org
Subject:   Re: Divert Socket Problem
Message-ID:  <346A6D3A.299F@eos.ncsu.edu>
References:  <199711130239.SAA13189@bubba.whistle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I should be damned, now the problem is solved. Archie is right, I forgot
use htons() to convert the port number. I have a "good reason" of not
doing that :-), I am refering "natd" source code, and it didn't use
htons at all, should that be a bug?

Thanks guys

/Feiyi 

Archie Cobbs wrote:
> 
> Feiyi Wang writes:
> > Hi, thanks very the input, but the problem looks hopeless :(
> >
> > - I am using the newest FreeBSD 2.2.5
> >
> > - Both DIVERT and FIREWALL have been enable in kernel, or else it won't
> > allow me to create a divert socket.
> >
> > - Return values of all system calls are checked, actually, the divert
> > socket fd is 3, (stdin, stdout, stderr, not it's 3, right?)
> >
> > - The firewall rule (sbin/ipfw divert 50000 89 from any to any)  seems
> > correct. I double check the ipfw synopsis.
> 
> Hmm, that's what I was afraid of :-)
> 
> Don't have your original email, but are you setting the
> addr.sin_port = 50000 instead of htons(50000)  ?
> 
> -Archie
> 
> ___________________________________________________________________________
> Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?346A6D3A.299F>