diff options
-rw-r--r-- | server/hostm.c | 10 | ||||
-rw-r--r-- | server/uloc.c | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/server/hostm.c b/server/hostm.c index d5b39a2..076568a 100644 --- a/server/hostm.c +++ b/server/hostm.c @@ -336,6 +336,8 @@ losinghost *which; ZServerDesc_t *server; ZNotice_t notice; struct sockaddr_in who; + Code_t retval; + char **buffer; int omask = sigblock(sigmask(SIGFPE)); /* don't start db dumps */ @@ -352,6 +354,8 @@ losinghost *which; xremque(which); hostm_flush(which->lh_host, server); + bzero((caddr_t)¬ice, sizeof(notice)); + /* tell other servers to flush this host */ notice.z_kind = HMCTL; notice.z_auth = 0; @@ -365,6 +369,12 @@ losinghost *which; notice.z_num_other_fields = 0; notice.z_message_len = 0; + /* generate the other fields */ + retval = ZFormatNotice(notice, &buffer, &len, ZNOAUTH); + if (retval != ZERR_NONE) + return; + xfree(*buffer); + /* forge a from address */ bzero((char *) &who, sizeof(who)); who.sin_addr.s_addr = which->lh_host->zh_addr.sin_addr.s_addr; diff --git a/server/uloc.c b/server/uloc.c index 7b25aaf..5ed666c 100644 --- a/server/uloc.c +++ b/server/uloc.c @@ -295,7 +295,6 @@ struct sockaddr_in *who; char *pkt; ZClient_t *client; - (void) bzero((char *)&sense_notice, sizeof(sense_notice)); /* XXX todo: have the messsage print the IP addr */ /* someone tried an unauthentic logout. Try to send a message @@ -313,6 +312,8 @@ struct sockaddr_in *who; owner.sin_addr.s_addr = loc->zlt_addr.s_addr; owner.sin_port = loc->zlt_port; + sense_notice = *notice; /* copy all fields */ + /* and change the ones we need to */ sense_notice.z_kind = ACKED; sense_notice.z_port = loc->zlt_port; sense_notice.z_class = "MESSAGE"; |