<div dir="ltr">Eugene -<div><br></div><div>Can you look at this PR and see if it fixes your issue:</div><div><br></div><div><a href="https://github.com/FRRouting/frr/pull/9098">https://github.com/FRRouting/frr/pull/9098</a><br></div><div><br></div><div>thanks!</div><div><br></div><div>donald</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 18, 2021 at 6:17 PM Eugene Grosbein <<a href="mailto:eugen@grosbein.net">eugen@grosbein.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">18.07.2021 18:30, Chriztoffer Hansen wrote:<br>
<br>
>> I'm trying to move from quagga to frr 7.5.1. I have existing working setup with OSPF<br>
>> and FreeBSD servers that have some aliases on its OSPF-enabled interfaces.<br>
>> In FreeBSD, if one needs several IP addresses in same IP subnet on one interfaces (for CARP etc.)<br>
>> then one assigns one of IPs with "real" subnet mask and others with /32 mask:<br>
<br>
[skip]<br>
<br>
I've used "show interface" command and noted that FRR marked my aliases as "unnumbered"<br>
instead of needed "secondary".<br>
<br>
I've spent some time making me familiar with FRR code a bit, and came with a patch that<br>
teaches FRR to flag aliases as "secondary" and this solves my problem: OSPF neighborship<br>
with Quagga is established. The patch is pretty naive and straightforward<br>
but I'm not sure if it is completely correct and/or effective.<br>
<br>
--- zebra/interface.c.orig 2021-03-04 02:14:50 UTC<br>
+++ zebra/interface.c<br>
@@ -358,7 +358,36 @@ int if_subnet_add(struct interface *ifp, struct connec<br>
<br>
if ((addr_list = rn->info))<br>
SET_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY);<br>
- else {<br>
+#ifdef __FreeBSD__<br>
+ else if (cp.prefixlen == 32) {<br>
+ struct listnode *node;<br>
+ struct connected *pc;<br>
+ struct prefix *p;<br>
+ uint32_t mask;<br>
+<br>
+ /*<br>
+ * Find any non-secondary AF_INET node with non-NULL info<br>
+ * that covers ifc.<br>
+ */<br>
+ for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, pc)) {<br>
+ if (CHECK_FLAG(pc->flags, ZEBRA_IFA_SECONDARY))<br>
+ continue;<br>
+ p = pc->address;<br>
+ if (p->family != AF_INET)<br>
+ continue;<br>
+ mask = ((1 << (32-p->prefixlen))-1);<br>
+ if ((p->u.prefix4.s_addr & mask) ==<br>
+ (cp.u.prefix4.s_addr & mask)) {<br>
+ rn = route_node_get(zebra_if->ipv4_subnets, p);<br>
+ if ((addr_list = rn->info)) {<br>
+ SET_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY);<br>
+ break;<br>
+ }<br>
+ }<br>
+ }<br>
+ }<br>
+#endif<br>
+ if(!addr_list) {<br>
UNSET_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY);<br>
rn->info = addr_list = list_new();<br>
route_lock_node(rn);<br>
<br>
<br>
<br>
</blockquote></div>