From e414e246d523631a486c825ca7e52b33e6768f78 Mon Sep 17 00:00:00 2001 From: Rajesh Varatharaj Date: Thu, 27 Apr 2023 14:30:59 -0700 Subject: [PATCH] pimd: capture pim_msg_send_frame return It's valuable to capture the return from and log the error. Otherwise, send failures will be silently ignored. Testing Done: pim-min, pim-smoke, Signed-off-by: Rajesh Varatharaj --- pimd/pim_iface.c | 2 +- pimd/pim_pim.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index da28cd6f8a4c..329023bca5e0 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -958,7 +958,7 @@ static int pim_iface_next_vif_index(struct interface *ifp) } /* - pim_if_add_vif() uses ifindex as vif_index + pim_if_add_vif() uses ifindex as mroute_vif_index see also pim_if_find_vifindex_by_ifindex() */ diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index 1bc265b138f6..86a4e22d2274 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -717,9 +717,8 @@ int pim_msg_send(int fd, pim_addr src, pim_addr dst, uint8_t *pim_msg, pim_pkt_dump(__func__, pim_msg, pim_msg_size); } - pim_msg_send_frame(fd, (char *)buffer, sendlen, (struct sockaddr *)&to, - tolen, ifp->name); - return 0; + return pim_msg_send_frame(fd, (char *)buffer, sendlen, + (struct sockaddr *)&to, tolen, ifp->name); #else struct iovec iovector[2]; @@ -727,9 +726,8 @@ int pim_msg_send(int fd, pim_addr src, pim_addr dst, uint8_t *pim_msg, iovector[0].iov_base = pim_msg; iovector[0].iov_len = pim_msg_size; - pim_msg_send_frame(src, dst, ifp->ifindex, &iovector[0], fd); + return pim_msg_send_frame(src, dst, ifp->ifindex, &iovector[0], fd); - return 0; #endif }