ipsk->dport = OSPF_PROTO;
#ifdef OSPFv2
- // ipsk->saddr = ifa->iface->addr->ip;
- ipsk->saddr = IPA_NONE;
+ /* FIXME - why there is IPA_NONE on multicast sockets ? */
+ if (mc)
+ ipsk->saddr = IPA_NONE;
+ else
+ ipsk->saddr = ifa->iface->addr->ip;
#else /* OSPFv3 */
ipsk->saddr = ifa->lladdr;
#endif
return 1;
}
- /* This is strange! */
+ /* We receive packets related to vlinks even on non-vlink sockets */
if ((ifa->oa->areaid != 0) && (ntohl(ps->areaid) == 0))
{
WALK_LIST(iff, po->iface_list)
}
}
+/* 16.1 calculating shortest paths for an area */
static void
ospf_rt_spfa(struct ospf_area *oa)
{
return 0;
}
+/* 16.3 examining summary-LSAs in transit areas */
static void
ospf_rt_sum_tr(struct ospf_area *oa)
{
if (en->domain != oa->areaid)
continue;
+ /* 16.3 (1a) */
if (en->lsa.age == LSA_MAXAGE)
continue;
- if (en->dist == LSINFINITY)
- continue;
+ // if (en->dist == LSINFINITY)
+ // continue;
+ /* 16.3 (2) */
if (en->lsa.rt == po->router_id)
continue;
re = (ort *) fib_find(&bb->rtr, &ip, pxlen);
}
+ /* 16.3 (1b) */
+ if (metric == LSINFINITY)
+ continue;
+
+ /* 16.3 (3) */
if (!re) continue;
if (re->n.oa->areaid != 0) continue;
if ((re->n.type != RTS_OSPF) && (re->n.type != RTS_OSPF_IA)) continue;
+ /* 16.3. (4) */
abrip = ipa_from_rid(en->lsa.rt);
-
abr = fib_find(&oa->rtr, &abrip, MAX_PREFIX_LENGTH);
if (!abr) continue;
}
}
-
+/* 16.2 calculating inter-area routes */
static void
ospf_rt_sum(struct ospf_area *oa)
{