summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorckishimo <carles.kishimoto@gmail.com>2021-02-23 15:50:30 +0100
committerckishimo <carles.kishimoto@gmail.com>2021-02-23 18:04:27 +0100
commit600d28e311ba1372d2536ebda39efde2b6ce1e64 (patch)
tree05316fa917340def10719efb657ef6b60b350510
parent8ae79ff2692f1cfd615d7f64194cce23b740055c (diff)
ospf6d: add DN bit in prefix options
According to RFC 5340 appendix A.4.1.1 0 1 2 3 4 5 6 7 +--+--+--+--+--+-+--+--+ | | | |DN| P|x|LA|NU| +--+--+--+--+--+-+--+--+ Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
-rw-r--r--ospf6d/ospf6_proto.c21
-rw-r--r--ospf6d/ospf6_proto.h2
2 files changed, 9 insertions, 14 deletions
diff --git a/ospf6d/ospf6_proto.c b/ospf6d/ospf6_proto.c
index a746037ec5..e60d2c7e0e 100644
--- a/ospf6d/ospf6_proto.c
+++ b/ospf6d/ospf6_proto.c
@@ -60,21 +60,14 @@ void ospf6_prefix_apply_mask(struct ospf6_prefix *op)
void ospf6_prefix_options_printbuf(uint8_t prefix_options, char *buf, int size)
{
- const char *p, *mc, *la, *nu;
+ const char *dn, *p, *mc, *la, *nu;
- p = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_P)
- ? "P"
- : "--");
- mc = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_MC)
- ? "MC"
- : "--");
- la = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_LA)
- ? "LA"
- : "--");
- nu = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_NU)
- ? "NU"
- : "--");
- snprintf(buf, size, "%s|%s|%s|%s", p, mc, la, nu);
+ dn = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_DN) ? "DN" : "--");
+ p = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_P) ? "P" : "--");
+ mc = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_MC) ? "MC" : "--");
+ la = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_LA) ? "LA" : "--");
+ nu = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_NU) ? "NU" : "--");
+ snprintf(buf, size, "%s|%s|%s|%s|%s", dn, p, mc, la, nu);
}
void ospf6_capability_printbuf(char capability, char *buf, int size)
diff --git a/ospf6d/ospf6_proto.h b/ospf6d/ospf6_proto.h
index 3876a98c50..da6b270e01 100644
--- a/ospf6d/ospf6_proto.h
+++ b/ospf6d/ospf6_proto.h
@@ -69,6 +69,8 @@ struct ospf6_prefix {
#define OSPF6_PREFIX_OPTION_LA (1 << 1) /* Local Address */
#define OSPF6_PREFIX_OPTION_MC (1 << 2) /* MultiCast */
#define OSPF6_PREFIX_OPTION_P (1 << 3) /* Propagate (NSSA) */
+#define OSPF6_PREFIX_OPTION_DN \
+ (1 << 4) /* DN bit to prevent loops in VPN environment */
/* caddr_t OSPF6_PREFIX_BODY (struct ospf6_prefix *); */
#define OSPF6_PREFIX_BODY(x) ((caddr_t)(x) + sizeof(struct ospf6_prefix))