summaryrefslogtreecommitdiff
path: root/mactelnetd.c
diff options
context:
space:
mode:
authorHåkon Nessjøen <haakon.nessjoen@gmail.com>2010-12-23 03:33:51 +0100
committerHåkon Nessjøen <haakon.nessjoen@gmail.com>2010-12-23 03:33:51 +0100
commitfae8147bc4a3c646dfa852074266b23f8a242450 (patch)
tree6325cea27dc1805c18e0ec0a1092407475901fdd /mactelnetd.c
parentff590f394b61c88922ef5a5bb5349b81c6d0be55 (diff)
downloadMAC-Telnet-fae8147bc4a3c646dfa852074266b23f8a242450.tar.gz
MAC-Telnet-fae8147bc4a3c646dfa852074266b23f8a242450.zip
Show mac address of client in syslog, and save correct mac address for wtmp.
Diffstat (limited to 'mactelnetd.c')
-rw-r--r--mactelnetd.c4
1 files changed, 2 insertions, 2 deletions
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);