Subject: Re: fingerd.c question
To: Dave Burgess <burgess@cynjut.neonramp.com>
From: Marc Baudoin <Marc.Baudoin@hsc.fr>
List: current-users
Date: 05/30/1996 11:59:45
Dave Burgess <burgess@cynjut.neonramp.com> écrit :
>
> The definition of getpeername() used in the (currently unused) LOGGING
> code segment calls for a "sockaddr_in sin" as the second argument to
> getpeername(). The getpeername() man page says that the second argument
> should be a sockaddr structure.
It is because all networking functions (getpeername(), bind() and so on)
take a struct sockaddr * as an argument and this structure is a generic
address structure. But in real life, one has to use a real structure such
as struct sockaddr_in which represent an IP address, port... So those
networking functions take in fact a struct sockaddr_in * casted as a struct
sockaddr *. It is like that since a long time and it's perfectly OK.
--
Marc Baudoin | e-mail <Marc.Baudoin@hsc.fr>
Hervé Schauer Consultants | WWW http://www.hsc.fr/
142 rue de Rivoli | Téléphone +33 (1) 46 38 89 90
75039 PARIS CEDEX 01 | Fax +33 (1) 46 38 05 05