Skip to content

Commit

Permalink
pimd: capture pim_msg_send_frame return
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
routingrocks authored and donaldsharp committed Dec 13, 2024
1 parent dfed9dd commit e414e24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pimd/pim_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()
*/
Expand Down
8 changes: 3 additions & 5 deletions pimd/pim_pim.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,19 +717,17 @@ 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];

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
}

Expand Down

0 comments on commit e414e24

Please sign in to comment.