*BSD News Article 96341


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!metro!munnari.OZ.AU!spool.mu.edu!uwm.edu!cs.utexas.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!news.apfel.de!univ-lyon1.fr!fdn.fr!r2d2.fdn.org!sphynx.fdn.fr!causse
From: causse@sphynx.fdn.fr (Philippe Causse)
Subject: Re: Accept()-ing a connection from a specific IP address...
X-Newsreader: TIN [version 1.2 PL2]
Organization: individual - paris - france
Message-ID: <EAv0wr.ts@sphynx.fdn.fr>
References: <864144757.18711@dejanews.com> <EAHuuM.129@sphynx.fdn.fr> <5mbbbj$ngq@uriah.heep.sax.de>
Date: Tue, 27 May 1997 21:55:38 GMT
Lines: 29
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:41735

J Wunsch (j@uriah.heep.sax.de) wrote:
[snip]

: Right, but confirmation of the connection is actually only achieved by
: reading the first data portion.  You can still reject the connection
: at this step.  Except of the delay in the handling, this should be
: indistingiushible from a server not running at all.

J"org,

Thanks for the pointing me to the accept(2) manpage but I couldn't guess
what to put in the control message!
I'll still spook arround in Comer's books to get the answer but, for the
moment, I don't have any clue about what should be written in
the struct cmsghdr :(
The manpage also says that the same result could be achieved with a
getsockopt(), however I didn't find any socket option which does the job.
At best, it returns the "next hop IP address", which is not what we
want in this case. We need the source IP address, not the gateway's addr.
I'm still puzzled....
If you have a working code sample, could you please post it ?

Thanks.

[snip]
-- 
-------------------------------------------------------------------
P. Causse			http://www.fdn.fr/~pcausse
4.4BSD/X11R6/Motif-2.0/C++	mailto:causse@sphynx.fdn.fr (UUCP)