From 686967467cb9a9d1c469c57c453667315d7be7e5 Mon Sep 17 00:00:00 2001 From: Reuben Dowle Date: Thu, 18 Mar 2021 15:40:09 +1300 Subject: [PATCH] ospfd: Suppress spurious write message when using ip nhrp map multicast When ip nhrp map multicast is being used, this is usually accompanied by an iptables rule to block the original multicast packet. This causes sendmsg to return EPERM. Signed-off-by: Reuben Dowle --- ospfd/ospf_packet.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 3f01bf34d3..aa98d7dd28 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -799,7 +799,13 @@ static int ospf_write(struct thread *thread) &iph.ip_dst, iph.ip_id, iph.ip_off, iph.ip_len, oi->ifp->name, oi->ifp->mtu); - if (ret < 0) + /* sendmsg will return EPERM if firewall is blocking sending. + * This is a normal situation when 'ip nhrp map multicast xxx' + * is being used to send multicast packets to DMVPN peers. In + * that case the original message is blocked with iptables rule + * causing the EPERM result + */ + if (ret < 0 && errno != EPERM) flog_err( EC_LIB_SOCKET, "*** sendmsg in ospf_write failed to %pI4, id %d, off %d, len %d, interface %s, mtu %u: %s", -- 2.39.5