summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zhm/zhm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/zhm/zhm.c b/zhm/zhm.c
index b24f4af..ec6723c 100644
--- a/zhm/zhm.c
+++ b/zhm/zhm.c
@@ -416,6 +416,7 @@ send_stats(notice, sin)
char *bfr;
char *list[20];
int len, i, nitems = 10;
+ char version[BUFSIZ];
newnotice = *notice;
@@ -449,6 +450,13 @@ send_stats(notice, sin)
list[9] = (char *)malloc(32);
(void)strcpy(list[9], MACHINE);
+ /* Since ZFormatRaw* won't change the version number on notices,
+ we need to set the version number explicitly. This code is taken
+ from Zinternal.c, function Z_FormatHeader */
+ (void) sprintf(version, "%s%d.%d", ZVERSIONHDR, ZVERSIONMAJOR,
+ ZVERSIONMINOR);
+ newnotice.z_version = version;
+
if ((ret = ZFormatRawNoticeList(&newnotice, list, nitems, &bfr,
&len)) != ZERR_NONE) {
syslog(LOG_INFO, "Couldn't format stats packet");