* Local stub networks does not have proper iface in en->nhi
* (because they all have common top_hash_entry en).
* We have to find iface responsible for that stub network.
- * Some stubnets does not have any iface. Ignore them.
+ * Configured stubnets does not have any iface. They will
+ * be removed in rt_sync().
*/
nf.ifa = find_stub_src(oa, px, pxlen);
nf.nh = IPA_NONE;
-
- if (!nf.ifa)
- return;
}
ri_install_net(oa->po, px, pxlen, &nf);
return 0;
/* 12.4.3 p4 */
- if (nf->n.ifa->oa->areaid == oa->areaid)
+ if (nf->n.ifa && (nf->n.ifa->oa->areaid == oa->areaid))
return 0;
/* 12.4.3 p5 */
/* RFC 2328 G.3 - incomplete resolution of virtual next hops */
- if (nf->n.type && (nf->n.ifa->type == OSPF_IT_VLINK))
+ if (nf->n.type && nf->n.ifa && (nf->n.ifa->type == OSPF_IT_VLINK))
reset_ri(&nf->n);
if ((nf2->n.type != RTS_OSPF) && (nf2->n.type != RTS_OSPF_IA))
continue;
+ /* Next-hop is a part of a configured stubnet */
+ if (!nf2->n.ifa)
+ continue;
+
/* If nh is zero, it is a device route */
nh = ipa_nonzero(nf2->n.nh) ? nf2->n.nh : rt_fwaddr;
nhi = nf2->n.ifa;
if (po->areano > 1)
check_sum_net_lsa(po, nf);
+ /* Remove configured stubnets */
+ if (!nf->n.ifa)
+ reset_ri(&nf->n);
+
if (reload || memcmp(&nf->n, &nf->o, sizeof(orta)))
{
net *ne = net_get(p->table, nf->fn.prefix, nf->fn.pxlen);
* - nodes may be invalid (fn.type == 0), in that case other invariants don't hold
* - n.metric1 may be at most a small multiple of LSINFINITY,
* therefore sums do not overflow
- * - n.oa and n.ifa are always non-NULL
+ * - n.oa is always non-NULL
+ * - n.ifa is always non-NULL with one exception - configured stubnet
+ nodes (in po->rtf). In that case, n.nh is IFA_NONE.
* - oa->rtr does not contain calculating router itself
*/