Date: Thu, 29 Nov 2001 13:45:44 +0300 From: "Sergey V. Artjushkin" <skiv@caravan.ru> To: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> Cc: freebsd-questions@freebsd.org Subject: Re: get client ip from accept(2) ? Message-ID: <3C0611D8.6090207@caravan.ru> References: <3C052091.70205@caravan.ru> <008601c178b7$581c9120$6d36120a@comsys.ntukpi.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello
Andrey Simonenko wrote:
> Give us more lines from your program, especially
> it is interesting to see how do you define variables.
I'm already fix my trouble.
Thanks to everybody who answer to my letter!
I wrote code like this:
socklen_t l_addrlen;
struct sockaddr l_cliaddr;
bzero(&l_cliaddr,sizeof(l_cliaddr));
/* printf("incoming connection on tcp 4444\n");*/
l_addrlen=sizeof(l_cliaddr);
if ( (l_connfd = accept(l_fd,(struct sockaddr *) &l_cliaddr,
&l_addrlen)) < 0)
{ log_error("accept error"); exit(0); }
> ----- Original Message -----
> From: Sergey V. Artjushkin <skiv@caravan.ru>
> Newsgroups: lucky.freebsd.questions
> Sent: Wednesday, November 28, 2001 8:36 PM
> Subject: get client ip from accept(2) ?
>
>
>
>
>>I'm trying to find out the client ip that connects to this server.
>>But l_cliaddr structure is NULL after succesfull accept call.
>>As I understand from manuals in this structure must be client ip.
>>Where I'm wrong and how I can get this ip?
--
With best regards.
------------------------------------------------------------------
Sergey Artjushkin Network Operation Center
(SKIV-RIPE) ISP "CARAVAN"
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C0611D8.6090207>
