diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-02-13 15:40:22 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-02-13 15:53:36 +0100 |
commit | 4a3f5b36173299d44e26dc18db4e5d103875f8c4 (patch) | |
tree | 32dc2a83fb27d8d52a2dacba28edf295575aa520 /proto/ospf/rt.c | |
parent | 1e958e52d3ef0c38e5fb5e673bcce95d1c28ac0e (diff) |
OSPF: Basic support for DN-bit handling (RFC 4576)
External LSAs originated by OSPF routers with VPN-PE behavior enabled are
marked by DN flag and they are ignored by other OSPF routers with VPN-PE
enabled.
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r-- | proto/ospf/rt.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c index 4549ce2a..c580d06e 100644 --- a/proto/ospf/rt.c +++ b/proto/ospf/rt.c @@ -782,6 +782,10 @@ ospf_rt_sum(struct ospf_area *oa) if (pxopts & OPT_PX_NU) continue; + /* RFC 4576 4 - do not use LSAs with DN-bit on PE-routers */ + if (p->vpn_pe && (pxopts & OPT_PX_DN)) + continue; + options = 0; type = ORT_NET; } @@ -879,6 +883,10 @@ ospf_rt_sum_tr(struct ospf_area *oa) if (pxopts & OPT_PX_NU) continue; + /* RFC 4576 4 - do not use LSAs with DN-bit on PE-routers */ + if (p->vpn_pe && (pxopts & OPT_PX_DN)) + continue; + re = fib_find(&p->rtf, &net); } else // en->lsa_type == LSA_T_SUM_RT @@ -1104,11 +1112,11 @@ check_nssa_lsa(struct ospf_proto *p, ort *nf) /* RFC 3101 3.2 (3) - originate the aggregated address range */ if (anet && anet->active && !anet->hidden && oa->translate) ospf_originate_ext_lsa(p, NULL, nf, LSA_M_RTCALC, anet->metric, - (anet->metric & LSA_EXT3_EBIT), IPA_NONE, anet->tag, 0); + (anet->metric & LSA_EXT3_EBIT), IPA_NONE, anet->tag, 0, 0); /* RFC 3101 3.2 (2) - originate the same network */ else if (decide_nssa_lsa(p, nf, &rt)) - ospf_originate_ext_lsa(p, NULL, nf, LSA_M_RTCALC, rt.metric, rt.ebit, rt.fwaddr, rt.tag, 0); + ospf_originate_ext_lsa(p, NULL, nf, LSA_M_RTCALC, rt.metric, rt.ebit, rt.fwaddr, rt.tag, 0, 0); } /* RFC 2328 16.7. p2 - find new/lost vlink endpoints */ @@ -1238,7 +1246,7 @@ ospf_rt_abr1(struct ospf_proto *p) if (oa_is_nssa(oa) && oa->ac->default_nssa) ospf_originate_ext_lsa(p, oa, default_nf, LSA_M_RTCALC, oa->ac->default_cost, - (oa->ac->default_cost & LSA_EXT3_EBIT), IPA_NONE, 0, 0); + (oa->ac->default_cost & LSA_EXT3_EBIT), IPA_NONE, 0, 0, 0); /* RFC 2328 16.4. (3) - precompute preferred ASBR entries */ if (oa_is_ext(oa)) @@ -1474,6 +1482,10 @@ ospf_ext_spf(struct ospf_proto *p) if (rt.pxopts & OPT_PX_NU) continue; + /* RFC 4576 4 - do not use LSAs with DN-bit on PE-routers */ + if (p->vpn_pe && rt.downwards) + continue; + /* 16.4. (3) */ /* If there are more areas, we already precomputed preferred ASBR entries in ospf_rt_abr1() and stored them in the backbone |