diff options
| author | Jafar Al-Gharaibeh <Jafaral@users.noreply.github.com> | 2021-04-13 12:49:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-13 12:49:28 -0500 |
| commit | d75213d26036a2880f23f5e67cb1c890f20299de (patch) | |
| tree | 704214848af1d599fa2b945c0f7e311a9923f6e6 /ospfd/ospf_packet.c | |
| parent | 0ae24ff56611e9151e0c061910ad34fee9fac53b (diff) | |
| parent | 46d3c1859ba622547529cd917c3853c71ee919fe (diff) | |
Merge pull request #8153 from reubendowle/nhrp-multicast
nhrp, ospf: add nhrp multicast for OSPF DMVPN
Diffstat (limited to 'ospfd/ospf_packet.c')
| -rw-r--r-- | ospfd/ospf_packet.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 0fd4803c79..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", @@ -907,8 +913,11 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh, /* Compare network mask. */ /* Checking is ignored for Point-to-Point and Virtual link. */ + /* Checking is also ignored for Point-to-Multipoint with /32 prefix */ if (oi->type != OSPF_IFTYPE_POINTOPOINT - && oi->type != OSPF_IFTYPE_VIRTUALLINK) + && oi->type != OSPF_IFTYPE_VIRTUALLINK + && !(oi->type == OSPF_IFTYPE_POINTOMULTIPOINT + && oi->address->prefixlen == IPV4_MAX_BITLEN)) if (oi->address->prefixlen != p.prefixlen) { flog_warn( EC_OSPF_PACKET, @@ -2427,6 +2436,11 @@ static int ospf_check_network_mask(struct ospf_interface *oi, || oi->type == OSPF_IFTYPE_VIRTUALLINK) return 1; + /* Ignore mask check for max prefix length (32) */ + if (oi->type == OSPF_IFTYPE_POINTOMULTIPOINT + && oi->address->prefixlen == IPV4_MAX_BITLEN) + return 1; + masklen2ip(oi->address->prefixlen, &mask); me.s_addr = oi->address->u.prefix4.s_addr & mask.s_addr; |
