From fae8147bc4a3c646dfa852074266b23f8a242450 Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Thu, 23 Dec 2010 03:33:51 +0100 Subject: Show mac address of client in syslog, and save correct mac address for wtmp. --- mactelnetd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mactelnetd.c') diff --git a/mactelnetd.c b/mactelnetd.c index a07fdb3..bb7ad28 100644 --- a/mactelnetd.c +++ b/mactelnetd.c @@ -197,7 +197,7 @@ void adduwtmp(struct mt_connection *curconn) { strncpy(utent.ut_user, curconn->username, sizeof(utent.ut_user)); strncpy(utent.ut_line, line, sizeof(utent.ut_line)); strncpy(utent.ut_id, utent.ut_line + 3, sizeof(utent.ut_id)); - strncpy(utent.ut_host,ether_ntoa((const struct ether_addr *)curconn->dstmac), sizeof(utent.ut_host)); + strncpy(utent.ut_host,ether_ntoa((const struct ether_addr *)curconn->srcmac), sizeof(utent.ut_host)); time(&utent.ut_time); /* Update utmp and/or wtmp */ @@ -453,7 +453,7 @@ void handlePacket(unsigned char *data, int data_len, const struct sockaddr_in *a switch (pkthdr.ptype) { case MT_PTYPE_SESSIONSTART: - syslog(LOG_DEBUG, "(%d) New connection.", pkthdr.seskey); + syslog(LOG_DEBUG, "(%d) New connection from %s.", pkthdr.seskey, ether_ntoa((struct ether_addr*)&(pkthdr.srcaddr))); curconn = calloc(1, sizeof(struct mt_connection)); curconn->seskey = pkthdr.seskey; curconn->lastdata = time(NULL); -- cgit v1.2.3