From 56e52d830b6cefeb7aea78d63229589559706080 Mon Sep 17 00:00:00 2001 From: Loganaden Velvindron Date: Thu, 8 Jun 2023 14:48:17 +0400 Subject: [PATCH] vrrp: check return value for turning off multicast for v6 CID1519841: check return value and set error Signed-off-by: Loganaden Velvindron --- vrrpd/vrrp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c index 7a779307d9..b14a6ecc47 100644 --- a/vrrpd/vrrp.c +++ b/vrrpd/vrrp.c @@ -1240,7 +1240,13 @@ static int vrrp_socket(struct vrrp_router *r) } /* Turn off multicast loop on Tx */ - setsockopt_ipv6_multicast_loop(r->sock_tx, 0); + if (setsockopt_ipv6_multicast_loop(r->sock_tx, 0) < 0) { + zlog_warn(VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM + "Failed to turn off IPv6 multicast", + r->vr->vrid, family2str(r->family)); + failed = true; + goto done; + } /* Bind Rx socket to exact interface */ frr_with_privs(&vrrp_privs) { -- 2.39.5