summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_packet.c
diff options
context:
space:
mode:
authorReuben Dowle <reuben.dowle@4rf.com>2021-03-18 03:40:09 +0100
committerReuben Dowle <reuben.dowle@4rf.com>2021-04-05 23:23:42 +0200
commit686967467cb9a9d1c469c57c453667315d7be7e5 (patch)
treed633c41d066fca47f99c8e3c1b5ec2e5669a4db8 /ospfd/ospf_packet.c
parentospfd: changes for PMP network /32 prefix length (diff)
downloadfrr-686967467cb9a9d1c469c57c453667315d7be7e5.tar.xz
frr-686967467cb9a9d1c469c57c453667315d7be7e5.zip
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 <reuben.dowle@4rf.com>
Diffstat (limited to 'ospfd/ospf_packet.c')
-rw-r--r--ospfd/ospf_packet.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 3f01bf34d..aa98d7dd2 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",