Skip to content

Commit

Permalink
ipvs: fix building with SNMP support without using netlink interface
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
  • Loading branch information
pqarmitage committed Apr 28, 2024
1 parent 2e165df commit 5a85dec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion keepalived/check/libipvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ static int ipvs_getinfo_parse_cb(struct nl_msg *msg, __attribute__((unused)) voi

return NL_OK;
}
#endif

static int ipvs_getinfo(void)
{
Expand All @@ -391,18 +392,19 @@ static int ipvs_getinfo(void)

ipvs_func = ipvs_getinfo;

#ifdef LIBIPVS_USE_NL
if (try_nl) {
struct nl_msg *msg;
if (!(msg = ipvs_nl_message(IPVS_CMD_GET_INFO, 0)))
return -1;

return ipvs_nl_send_message(msg, ipvs_getinfo_parse_cb, NULL);
}
#endif

len = sizeof(ipvs_info);
return getsockopt(sockfd, IPPROTO_IP, IP_VS_SO_GET_INFO, &ipvs_info, &len);
}
#endif

int ipvs_init(void)
{
Expand Down

0 comments on commit 5a85dec

Please sign in to comment.