Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: Fix pseudowires with backup nexthops (backport #8731) #9174

Merged
merged 4 commits into from Jul 24, 2021

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Jul 24, 2021

This is an automatic backport of pull request #8731 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.io/

Mark Stapp added 4 commits July 24, 2021 17:16
Use const in common rib_match api.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
(cherry picked from commit bc77c3b)
Add a boolean to control whether pseudowire reachability
checking needs to be strict.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
(cherry picked from commit 6fb3580)
Modify the pseudowire reachability logic so that it returns
success if there is at least one installed labelled nexthop for
the route resolving the pw destination. We also check for
valid backup nexthops if necessary, in case there's been a
switchover event.
Only OpenBSD requires that _all_ nexthops be labelled, so we
have a more strict version of the logic also.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
(cherry picked from commit 0d145d4)
Include the complete set of primary and backup nexthops from
the resolving route for a pseudowire. Add accessors for that
info. Modify the logic that creates the fib set of pw nexthops
so that only installed, labelled nexthops are included.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
(cherry picked from commit 072b487)
Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/8fd03cf506f3381f55043682c7d289e8/raw/c5b598374f40c254276a6644641f3c5541214dc1/cr_9174_1627147029.diff | git apply

diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index a5d672987..2980ffbd2 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -2550,7 +2550,7 @@ static int dplane_ctx_pw_init(struct zebra_dplane_ctx *ctx,
 		goto done;
 
 	re = NULL;
-	RNODE_FOREACH_RE(rn, re) {
+	RNODE_FOREACH_RE (rn, re) {
 		if (CHECK_FLAG(re->flags, ZEBRA_FLAG_SELECTED))
 			break;
 	}
diff --git a/zebra/zebra_pw.c b/zebra/zebra_pw.c
index 6b4a81515..d64e082c9 100644
--- a/zebra/zebra_pw.c
+++ b/zebra/zebra_pw.c
@@ -298,8 +298,8 @@ done:
 
 	if (fail_p || !found_p) {
 		if (IS_ZEBRA_DEBUG_PW)
-			zlog_debug("%s: unlabeled route for %s",
-				   __func__, pw->ifname);
+			zlog_debug("%s: unlabeled route for %s", __func__,
+				   pw->ifname);
 		return -1;
 	}
 
@@ -339,8 +339,8 @@ static int zebra_pw_check_reachability(const struct zebra_pw *pw)
 			if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
 				continue;
 
-			if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE) &&
-			    nexthop->nh_label != NULL) {
+			if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)
+			    && nexthop->nh_label != NULL) {
 				found_p = true;
 				break;
 			}
@@ -356,8 +356,8 @@ static int zebra_pw_check_reachability(const struct zebra_pw *pw)
 			if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
 				continue;
 
-			if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE) &&
-			    nexthop->nh_label != NULL) {
+			if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)
+			    && nexthop->nh_label != NULL) {
 				found_p = true;
 				break;
 			}
@@ -366,8 +366,8 @@ static int zebra_pw_check_reachability(const struct zebra_pw *pw)
 
 	if (!found_p) {
 		if (IS_ZEBRA_DEBUG_PW)
-			zlog_debug("%s: unlabeled route for %s",
-				   __func__, pw->ifname);
+			zlog_debug("%s: unlabeled route for %s", __func__,
+				   pw->ifname);
 		return -1;
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

After making changes, you do not need to create a new PR. You should perform an amend or interactive rebase followed by a force push.

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-20503/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@mwinter-osr mwinter-osr merged commit a7dc558 into stable/8.0 Jul 24, 2021
@mergify mergify bot deleted the mergify/bp/stable/8.0/pr-8731 branch July 24, 2021 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants