summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHåkon Nessjøen <haakon.nessjoen@gmail.com>2012-11-25 18:21:25 +0100
committerHåkon Nessjøen <haakon.nessjoen@gmail.com>2012-11-25 18:21:25 +0100
commited9ad7793e563253865ad91f9570d26da2e94640 (patch)
treeaa7857b919e6e3aa080b6e3a9e479462c8d436d3
parent74a0fe57a9dfc0b34de33eb4238fd7a2f60a2f27 (diff)
downloadMAC-Telnet-ed9ad7793e563253865ad91f9570d26da2e94640.tar.gz
MAC-Telnet-ed9ad7793e563253865ad91f9570d26da2e94640.zip
A few fixes taken from aouyar/MAC-Telnet
-rw-r--r--mactelnet.c2
-rw-r--r--mactelnetd.c3
-rw-r--r--mndp.c5
-rw-r--r--protocol.h2
4 files changed, 9 insertions, 3 deletions
diff --git a/mactelnet.c b/mactelnet.c
index 19624ea..ad2c985 100644
--- a/mactelnet.c
+++ b/mactelnet.c
@@ -592,7 +592,7 @@ int main (int argc, char **argv) {
inet_pton(AF_INET, (char *)"255.255.255.255", &destip);
memcpy(&sourceip, &(si_me.sin_addr), IPV4_ALEN);
- /* Sessioon key */
+ /* Session key */
sessionkey = rand() % 65535;
/* stop output buffering */
diff --git a/mactelnetd.c b/mactelnetd.c
index 1738ce8..2c31e90 100644
--- a/mactelnetd.c
+++ b/mactelnetd.c
@@ -803,6 +803,7 @@ void mndp_broadcast() {
mndp_add_attribute(&pdata, MT_MNDPTYPE_PLATFORM, PLATFORM_NAME, strlen(PLATFORM_NAME));
mndp_add_attribute(&pdata, MT_MNDPTYPE_HARDWARE, s_uname.machine, strlen(s_uname.machine));
mndp_add_attribute(&pdata, MT_MNDPTYPE_TIMESTAMP, &uptime, 4);
+ mndp_add_attribute(&pdata, MT_MNDPTYPE_SOFTID, MT_SOFTID_MACTELNET, strlen(MT_SOFTID_MACTELNET));
header->cksum = in_cksum((unsigned short *)&(pdata.data), pdata.size);
send_special_udp(interface, MT_MNDP_PORT, &pdata);
@@ -1019,7 +1020,7 @@ int main (int argc, char **argv) {
signal(SIGCHLD,SIG_IGN);
signal(SIGTSTP,SIG_IGN);
signal(SIGTTOU,SIG_IGN);
- signal(SIGTTIN,SIG_IGN);
+ signal(SIGTTIN,SIG_IGN);
signal(SIGHUP, sighup_handler);
signal(SIGTERM, sigterm_handler);
diff --git a/mndp.c b/mndp.c
index b229d3b..e8ba8e3 100644
--- a/mndp.c
+++ b/mndp.c
@@ -109,7 +109,10 @@ int mndp(void) {
printf(" (%s %s %s)", packet->platform, packet->version, packet->hardware);
}
if (packet->uptime > 0) {
- printf(_(" up %d days %d hours"), packet->uptime / 86400, packet->uptime % 86400 / 3600);
+ printf(_(" up %d days %d hours"), packet->uptime / 86400, packet->uptime % 86400 / 3600);
+ }
+ if (packet->softid != NULL) {
+ printf(" %s", packet->softid);
}
putchar('\n');
}
diff --git a/protocol.h b/protocol.h
index 11c9aca..28e0345 100644
--- a/protocol.h
+++ b/protocol.h
@@ -33,6 +33,8 @@
#define MT_MNDP_TIMEOUT 5
#define MT_MNDP_LONGTIMEOUT 120
+#define MT_SOFTID_MACTELNET "MAC-Telnet"
+
#ifndef ETH_ALEN
#define ETH_ALEN 6
#endif