summaryrefslogtreecommitdiff
path: root/proto/ospf/lsalib.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-02-13 15:40:22 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-02-13 15:53:36 +0100
commit4a3f5b36173299d44e26dc18db4e5d103875f8c4 (patch)
tree32dc2a83fb27d8d52a2dacba28edf295575aa520 /proto/ospf/lsalib.c
parent1e958e52d3ef0c38e5fb5e673bcce95d1c28ac0e (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/lsalib.c')
-rw-r--r--proto/ospf/lsalib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/proto/ospf/lsalib.c b/proto/ospf/lsalib.c
index e66d3dc0..7ddf64e3 100644
--- a/proto/ospf/lsalib.c
+++ b/proto/ospf/lsalib.c
@@ -336,9 +336,10 @@ lsa_parse_sum_net(struct top_hash_entry *en, int ospf2, int af, net_addr *net, u
{
if (ospf2)
{
+ uint opts = lsa_get_options(&en->lsa);
struct ospf_lsa_sum2 *ls = en->lsa_body;
net_fill_ip4(net, ip4_from_u32(en->lsa.id & ls->netmask), u32_masklen(ls->netmask));
- *pxopts = 0;
+ *pxopts = (opts & OPT_DN) ? OPT_PX_DN : 0;
*metric = ls->metric & LSA_METRIC_MASK;
}
else
@@ -386,6 +387,7 @@ lsa_parse_ext(struct top_hash_entry *en, int ospf2, int af, struct ospf_lsa_ext_
rt->tag = ext->tag;
rt->propagate = lsa_get_options(&en->lsa) & OPT_P;
+ rt->downwards = lsa_get_options(&en->lsa) & OPT_DN;
}
else
{
@@ -402,6 +404,7 @@ lsa_parse_ext(struct top_hash_entry *en, int ospf2, int af, struct ospf_lsa_ext_
rt->tag = (ext->metric & LSA_EXT3_TBIT) ? *buf++ : 0;
rt->propagate = rt->pxopts & OPT_PX_P;
+ rt->downwards = rt->pxopts & OPT_PX_DN;
}
}