summaryrefslogtreecommitdiff
path: root/ospfd/ospf_packet.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2023-07-11 11:47:32 -0400
committerGitHub <noreply@github.com>2023-07-11 11:47:32 -0400
commit6e89a5db228c75d83f9be7b3606b91257e0307d3 (patch)
tree3d8e0dc9474ea768c653b4d7697cbf1fe5c07112 /ospfd/ospf_packet.c
parentc8971388a9013ffb65b4de20fd1553f6e1e94311 (diff)
parente72549c8f6f7b25738f8d4c913db025a7906558e (diff)
Merge pull request #13691 from LabNConsulting/aceelindem/ospf-opaque-interface-disable
ospfd: Configurable interface-level 'capability opaque' support
Diffstat (limited to 'ospfd/ospf_packet.c')
-rw-r--r--ospfd/ospf_packet.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 105c04c7a1..cfa0d5d574 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -953,8 +953,9 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
}
#endif /* REJECT_IF_TBIT_ON */
- if (CHECK_FLAG(oi->ospf->config, OSPF_OPAQUE_CAPABLE)
- && CHECK_FLAG(hello->options, OSPF_OPTION_O)) {
+ if (CHECK_FLAG(oi->ospf->config, OSPF_OPAQUE_CAPABLE) &&
+ OSPF_IF_PARAM(oi, opaque_capable) &&
+ CHECK_FLAG(hello->options, OSPF_OPTION_O)) {
/*
* This router does know the correct usage of O-bit
* the bit should be set in DD packet only.
@@ -1362,8 +1363,9 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
}
#endif /* REJECT_IF_TBIT_ON */
- if (CHECK_FLAG(dd->options, OSPF_OPTION_O)
- && !CHECK_FLAG(oi->ospf->config, OSPF_OPAQUE_CAPABLE)) {
+ if (CHECK_FLAG(dd->options, OSPF_OPTION_O) &&
+ (!CHECK_FLAG(oi->ospf->config, OSPF_OPAQUE_CAPABLE) ||
+ !OSPF_IF_PARAM(oi, opaque_capable))) {
/*
* This node is not configured to handle O-bit, for now.
* Clear it to ignore unsupported capability proposed by
@@ -1448,7 +1450,8 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
/* This is where the real Options are saved */
nbr->options = dd->options;
- if (CHECK_FLAG(oi->ospf->config, OSPF_OPAQUE_CAPABLE)) {
+ if (CHECK_FLAG(oi->ospf->config, OSPF_OPAQUE_CAPABLE) &&
+ OSPF_IF_PARAM(oi, opaque_capable)) {
if (IS_DEBUG_OSPF_EVENT)
zlog_debug(
"Neighbor[%pI4] is %sOpaque-capable.",
@@ -3435,7 +3438,8 @@ static int ospf_make_db_desc(struct ospf_interface *oi,
/* Set Options. */
options = OPTIONS(oi);
- if (CHECK_FLAG(oi->ospf->config, OSPF_OPAQUE_CAPABLE))
+ if (CHECK_FLAG(oi->ospf->config, OSPF_OPAQUE_CAPABLE) &&
+ OSPF_IF_PARAM(oi, opaque_capable))
SET_FLAG(options, OSPF_OPTION_O);
if (OSPF_FR_CONFIG(oi->ospf, oi->area))
SET_FLAG(options, OSPF_OPTION_DC);