From: Amol Lad Date: Thu, 7 Jan 2021 08:04:00 +0000 (+0530) Subject: ospfd: changes for PMP network /32 prefix length X-Git-Tag: base_8.0~145^2~5 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=0c5506a856263828e8b0ed8e003203bd48ab569d;p=matthieu%2Ffrr.git ospfd: changes for PMP network /32 prefix length Operation with PMP network on /32 prefix is needed for DMVPN Signed-off-by: Reuben Dowle --- diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 0fd4803c79..3f01bf34d3 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -907,8 +907,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 +2430,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; diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c index 95553dacdf..0164bfac67 100644 --- a/ospfd/ospf_spf.c +++ b/ospfd/ospf_spf.c @@ -905,7 +905,9 @@ static unsigned int ospf_nexthop_calculation(struct ospf_area *area, * somehow. */ if (area->ospf->ti_lfa_enabled - || (oi && oi->type == OSPF_IFTYPE_POINTOPOINT)) { + || (oi && oi->type == OSPF_IFTYPE_POINTOPOINT) + || (oi && oi->type == OSPF_IFTYPE_POINTOMULTIPOINT + && oi->address->prefixlen == IPV4_MAX_BITLEN)) { struct ospf_neighbor *nbr_w = NULL; /* Calculating node is root node, link