From 4d13346c39f3bb69500ff43f7ed261add48c2390 Mon Sep 17 00:00:00 2001 From: Quentin Armitage Date: Mon, 29 Apr 2024 21:40:28 +0100 Subject: [PATCH] ipvs: Fix stats handling when only have 32 bit stats This resolves commit 930f3b72 "ipvs: Don't duplicate storage of 32 bit SNMP stats" Signed-off-by: Quentin Armitage --- doc/man/man5/keepalived.conf.5.in | 4 ++-- keepalived/check/libipvs.c | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/doc/man/man5/keepalived.conf.5.in b/doc/man/man5/keepalived.conf.5.in index 56077f0099..62830a4848 100644 --- a/doc/man/man5/keepalived.conf.5.in +++ b/doc/man/man5/keepalived.conf.5.in @@ -681,8 +681,8 @@ possibly following any cleanup actions needed. # When SNMP requests are made, the checker process only updates the # virtual and real server stats from the kernel if the last time the # stats for that virtual server were read was more than this configured - # interval. The default interval is 5 seconds, and the valid range is - # 1 milli-second to 30 seconds. + # interval (in seconds). The default interval is 5 seconds, and the + # valid range is 0.001 (1 milli-second) to 30 seconds. \fBsnmp_vs_stats_update_interval\fR # Like snmp_vs_stats_update_interval but for real servers. Stats for diff --git a/keepalived/check/libipvs.c b/keepalived/check/libipvs.c index f3ae74e8c0..9eb638a41e 100644 --- a/keepalived/check/libipvs.c +++ b/keepalived/check/libipvs.c @@ -961,7 +961,7 @@ static int ipvs_services_parse_cb(struct nl_msg *msg, void *arg) } else if (svc_attrs[IPVS_SVC_ATTR_STATS]) #endif { - if (ipvs_parse_stats64(&(get->user.entrytable[0].ip_vs_stats), + if (ipvs_parse_stats(&(get->user.entrytable[0].ip_vs_stats), svc_attrs[IPVS_SVC_ATTR_STATS]) != 0) return -1; } @@ -970,12 +970,6 @@ static int ipvs_services_parse_cb(struct nl_msg *msg, void *arg) get->user.num_services++; -#if 0 - get = REALLOC(get, sizeof(*get) - + sizeof(ipvs_service_entry_t) * (get->user.num_services + 1)); - *getp = get; -#endif - return 0; }