Hello Colleagues, I have some question about accept(2) functions. I have wrote the following programm:
------------------------------- /* set up the listening tcp socket*/ if ( (l_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { log_error("socket (tcp) error"); exit(0); } memset(&l_servaddr,0,sizeof(l_servaddr)); l_servaddr.sin_family = AF_INET; l_servaddr.sin_addr.s_addr = htonl(INADDR_ANY); l_servaddr.sin_port = htons(c_tcpport); if ( bind(l_fd,(struct sockaddr *) &l_servaddr, sizeof(l_servaddr)) < 0) { log_error ("bind TCP error"); exit(0); } if ( listen(l_fd, 32) < 0) { log_error("listen error"); exit(0); } if ( (l_connfd = accept(l_fd,(struct sockaddr *) l_cliaddr, &l_addrlen)) < 0) { log_error("accept error"); exit(0); } ---------------------------------------- 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? Thank you for advance. -- With best regards. ------------------------------------------------------------------ Sergey Artjushkin Network Operation Center (SKIV-RIPE) ISP "CARAVAN" To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message