diff options
author | Robert S. French <rfrench@mit.edu> | 1987-08-01 07:35:45 +0000 |
---|---|---|
committer | Robert S. French <rfrench@mit.edu> | 1987-08-01 07:35:45 +0000 |
commit | f4bb54ce0fb10f1e0529bf84a19ec8088dbf41f9 (patch) | |
tree | 5d142604b665a0b6cb904a9588ef9cecb9710ce8 | |
parent | 28bcad1020be28f6b3fbd68a4ff803c0dffd267c (diff) |
Changed to handle new protocol and packet format
-rw-r--r-- | server/hostm.c | 2 | ||||
-rw-r--r-- | server/main.c | 23 |
2 files changed, 11 insertions, 14 deletions
diff --git a/server/hostm.c b/server/hostm.c index e421384..3f373b0 100644 --- a/server/hostm.c +++ b/server/hostm.c @@ -555,6 +555,8 @@ ZServerDesc_t *server; shutnotice.z_opcode = SERVER_SHUTDOWN; shutnotice.z_sender = HM_CTL_SERVER; shutnotice.z_recipient = "hm@ATHENA.MIT.EDU"; + shutnotice.z_default_format = ""; + if (server) { shutnotice.z_message = inet_ntoa(server->zs_addr.sin_addr); shutnotice.z_message_len = strlen(shutnotice.z_message); diff --git a/server/main.c b/server/main.c index 1245e55..4600a92 100644 --- a/server/main.c +++ b/server/main.c @@ -115,7 +115,7 @@ int argc; char **argv; { int nfound; /* #fildes ready on select */ - int authentic; /* authentic flag for ZParseNotice */ + int authentic; /* authentic flag */ Code_t status; ZNotice_t new_notice; /* parsed from input_packet */ ZPacket_t input_packet; /* from the network */ @@ -250,9 +250,7 @@ char **argv; npackets++; if (status = ZParseNotice(input_packet, input_len, - &new_notice, - &authentic, - &whoisit)) { + &new_notice)) { syslog(LOG_ERR, "bad notice parse: %s", error_message(status)); @@ -267,17 +265,14 @@ char **argv; input_sin.sin_addr.s_addr = new_notice.z_sender_addr.s_addr; input_sin.sin_port = new_notice.z_port; input_sin.sin_family = AF_INET; - if (status = ZParseNotice(input_packet, - input_len, - &new_notice, - &authentic, - &input_sin)) { - syslog(LOG_ERR, - "bad srv notice parse: %s", - error_message(status)); - continue; - } + authentic = ZCheckAuthentication(&new_notice, + input_packet, + &input_sin); } + else + authentic = ZCheckAuthentication(&new_notice, + input_packet, + &whoisit); if (whoisit.sin_port != hm_port && strcmp(new_notice.z_class,ZEPHYR_ADMIN_CLASS) && whoisit.sin_port != sock_sin.sin_port && |