Always obtain IP address during accept(), and not do it later as a call to getsockname().

Signed-off-by: Jan Vidar Krey <janvidar@extatic.org>
This commit is contained in:
Jan Vidar Krey
2009-03-23 15:05:27 +01:00
parent 95b741bb5e
commit 5d5dda2f9b
3 changed files with 29 additions and 5 deletions

View File

@@ -83,8 +83,11 @@ extern int net_close(int fd);
/**
* A wrapper for the accept() function call.
* @param fd socket descriptor
* @param ipaddr (in/out) if non-NULL the ip address of the
* accepted peer is filled in.
*/
extern int net_accept(int fd);
extern int net_accept(int fd, struct ip_addr_encap* ipaddr);
/**
* A wrapper for the connect() call.