telnetd: fill hostname field in utmp/wtmp records

function                                             old     new   delta
get_lsa                                                -     109    +109
make_new_session                                     438     504     +66
get_peer_lsa                                           -      10     +10
ftpd_main                                           2340    2267     -73
get_sock_lsa                                         101      10     -91
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 1/2 up/down: 185/-164)           Total: 21 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-04-06 17:43:29 +02:00
parent fcad7681f8
commit f6916dbed4
4 changed files with 30 additions and 24 deletions

View File

@@ -461,21 +461,6 @@ handle_epsv(void)
free(response);
}
/* libbb candidate */
static
len_and_sockaddr* get_peer_lsa(int fd)
{
len_and_sockaddr *lsa;
socklen_t len = 0;
if (getpeername(fd, NULL, &len) != 0)
return NULL;
lsa = xzalloc(LSA_LEN_SIZE + len);
lsa->len = len;
getpeername(fd, &lsa->u.sa, &lsa->len);
return lsa;
}
static void
handle_port(void)
{