From: Reuben Dowle Date: Thu, 18 Mar 2021 02:40:09 +0000 (+1300) Subject: ospfd: Suppress spurious write message when using ip nhrp map multicast X-Git-Tag: base_8.0~145^2~4 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=686967467cb9a9d1c469c57c453667315d7be7e5;p=matthieu%2Ffrr.git 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 --- 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",