diff options
author | David C. Jedlinsky <opus@mit.edu> | 1987-07-29 10:53:00 +0000 |
---|---|---|
committer | David C. Jedlinsky <opus@mit.edu> | 1987-07-29 10:53:00 +0000 |
commit | 3d4a3919420a98e95ce19cdeae7472adcd3a4266 (patch) | |
tree | d55460d3fdfcccb8d3ce4313f241c3802e8172c7 /zhm/zhm.c | |
parent | 7a2ce9ef1185f6b91b74f09380415c74a434ce46 (diff) |
Throws away byte-swapped notices, ignores servers on the wrong port.
Diffstat (limited to 'zhm/zhm.c')
-rw-r--r-- | zhm/zhm.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -117,7 +117,10 @@ char *argv[]; (notice.z_kind == HMCTL)) { server_manager(¬ice); } else { - if (bcmp(loopback, &from.sin_addr, 4) == 0) { + if ((bcmp(loopback, &from.sin_addr, 4) == 0) && + ((notice.z_kind == UNSAFE) || + (notice.z_kind == UNACKED) || + (notice.z_kind == ACKED))) { /* Client program... */ transmission_tower(¬ice, packet); DPR2 ("Pending = %d\n", ZPending()); @@ -403,12 +406,13 @@ void set_sig_type(sig) server_manager(notice) ZNotice_t *notice; { - DPR ("A notice came in from the server.\n"); - if (bcmp(&serv_sin.sin_addr, &from.sin_addr, 4) != 0) { + if ((bcmp(&serv_sin.sin_addr, &from.sin_addr, 4) != 0) || + (serv_sin.sin_port != from.sin_port)) { syslog (LOG_INFO, "Bad notice from port %u.", notice->z_port); /* Sent a notice back saying this hostmanager isn't theirs */ } else { /* This is our server, handle the notice */ + DPR ("A notice came in from the server.\n"); nserv++; switch(notice->z_kind) { case HMCTL: |