[quagga-dev 10857] Re: [Design] OSPF unnumbered interfaces

Joakim Tjernlund joakim.tjernlund at transmode.se
Fri Oct 25 10:10:37 BST 2013


James Li <jli at cumulusnetworks.com> wrote on 2013/10/25 00:57:38:
> 
> Some design notes I had to accompany the unnumbered patch. The work was 
> based on 0.99.21, so part of it, the SPF nexthop changes, was already in 

> master via this patch 
> 
https://github.com/fweimer/quagga/commit/f2b53dac4c72811c06779c596c6162b994eb427a
. 
> I include it anyways for completeness.

...

nice notes but not really helpful for analysing the patch.

I suspect you can do the same much simpler. I GUESS it is enough to add:
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -547,10 +547,14 @@ lsa_link_ptop_set (struct stream *s, struct 
ospf_interface *oi)
                                LSA_LINK_TYPE_POINTOPOINT, 0, cost);
       }
 
+  masklen2ip (oi->address->prefixlen, &mask);
+  /* if mask is /32, treat this as an unnumbered interface */
+  if (mask.s_addr == ~0)
+    return links;
+
   /* Regardless of the state of the neighboring router, we must
      add a Type 3 link (stub network).
      N.B. Options 1 & 2 share basically the same logic. */
-  masklen2ip (oi->address->prefixlen, &mask);
   id.s_addr = CONNECTED_PREFIX(oi->connected)->u.prefix4.s_addr & 
mask.s_addr;
   links += link_info_set (s, id, mask, LSA_LINK_TYPE_STUB, 0,
                          oi->output_cost);

Then add my "interface" command, http://patchwork.diac24.net/patch/252/
Probably need some massage to apply these days.

 Jocke




More information about the Quagga-dev mailing list