]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: changes for PMP network /32 prefix length
authorAmol Lad <amol.lad@4rf.com>
Thu, 7 Jan 2021 08:04:00 +0000 (13:34 +0530)
committerReuben Dowle <reuben.dowle@4rf.com>
Mon, 5 Apr 2021 21:23:42 +0000 (09:23 +1200)
Operation with PMP network on /32 prefix is needed for DMVPN

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
ospfd/ospf_packet.c
ospfd/ospf_spf.c

index 0fd4803c7993efe57e25136834b2168dc25c3d46..3f01bf34d3e791af25e645c8418d13a00f463597 100644 (file)
@@ -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;
index 95553dacdfdf064785b4e610e01ce1bf7a4dfe80..0164bfac678dc490520e1e7544825f1c301c9c46 100644 (file)
@@ -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