]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Suppress spurious write message when using ip nhrp map multicast
authorReuben Dowle <reuben.dowle@4rf.com>
Thu, 18 Mar 2021 02:40:09 +0000 (15:40 +1300)
committerReuben Dowle <reuben.dowle@4rf.com>
Mon, 5 Apr 2021 21:23:42 +0000 (09:23 +1200)
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 <reuben.dowle@4rf.com>
ospfd/ospf_packet.c

index 3f01bf34d3e791af25e645c8418d13a00f463597..aa98d7dd285f51b884bbce74384e3fd05f85630e 100644 (file)
@@ -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",