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

bgpd: Allow using add/subtract for local-preference in route-maps #5855

Merged
merged 3 commits into from
Mar 2, 2020
Merged

bgpd: Allow using add/subtract for local-preference in route-maps #5855

merged 3 commits into from
Mar 2, 2020

Conversation

ton31337
Copy link
Member

See individual commits.

@polychaeta polychaeta added bgp documentation tests Topotests, make check, etc labels Feb 23, 2020
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/0e239cb274c125c92bfd2c17381956b5/raw/f81fddff1b29c02a4a0c135263ec02279494323f/cr_5855_1582488543.diff | git apply

diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 8f498fc3c..5330576ab 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -4398,12 +4398,10 @@ DEFUN (no_set_distance,
 				  "distance", NULL);
 }
 
-DEFUN (set_local_pref,
-       set_local_pref_cmd,
-       "set local-preference WORD",
-       SET_STR
-       "BGP local preference path attribute\n"
-       "Preference value\n")
+DEFUN(set_local_pref, set_local_pref_cmd, "set local-preference WORD",
+      SET_STR
+      "BGP local preference path attribute\n"
+      "Preference value\n")
 {
 	int idx_number = 2;
 	return generic_set_add(vty, VTY_GET_CONTEXT(route_map_index),
@@ -4411,13 +4409,10 @@ DEFUN (set_local_pref,
 }
 
 
-DEFUN (no_set_local_pref,
-       no_set_local_pref_cmd,
-       "no set local-preference WORD",
-       NO_STR
-       SET_STR
-       "BGP local preference path attribute\n"
-       "Preference value\n")
+DEFUN(no_set_local_pref, no_set_local_pref_cmd, "no set local-preference WORD",
+      NO_STR SET_STR
+      "BGP local preference path attribute\n"
+      "Preference value\n")
 {
 	int idx_localpref = 3;
 	if (argc <= idx_localpref)

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

@LabN-CI
Copy link
Collaborator

LabN-CI commented Feb 23, 2020

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result 0
Date 0
Start 0
Finish vncregress-2020-02-23-15:10:27.txt
Run-Time autoscript-2020-02-23-15:11:26.log.bz2
Total 494 466 418
Pass SUCCESS git merge/5421 b5d4d6a
Fail 11/23/2019
Valgrind-Errors 15:10:21
Valgrind-Loss 15:36:16
Details 25:55
Log 1815
Memory 1815
SUCCESS git merge/5855 1104603 0
02/23/2020 0
15:10:27 0
15:36:27 vncregress-2019-11-23-15:10:21.txt
26:00 autoscript-2019-11-23-15:11:15.log.bz2
1815 435 425 361
1815

For details, please contact louberger

@LabN-CI
Copy link
Collaborator

LabN-CI commented Feb 23, 2020

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result 0
Date 0
Start 0
Finish vncregress-2020-02-23-15:40:27.txt
Run-Time autoscript-2020-02-23-15:41:24.log.bz2
Total 479 486 418
Pass SUCCESS git merge/5422 a307391
Fail 11/23/2019
Valgrind-Errors 15:40:27
Valgrind-Loss 16:06:14
Details 25:47
Log 1815
Memory 1815
SUCCESS git merge/5855 3bbbc27 0
02/23/2020 0
15:40:27 0
16:06:16 vncregress-2019-11-23-15:40:27.txt
25:49 autoscript-2019-11-23-15:41:21.log.bz2
1815 414 422 360
1815

For details, please contact louberger

@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-10842/

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.


CLANG Static Analyzer Summary

  • Github Pull Request 5855, comparing to Git base SHA 9a6e190
  • Base image data for Git 9a6e190 does not exist - compare skipped

2 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-10842/artifact/shared/static_analysis/index.html

@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-10841/

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.

Warnings Generated during build:

Debian 10 amd64 build: Successful with additional warnings

Debian Package lintian failed for Debian 10 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-10841/artifact/DEB10BUILD/ErrorLog/log_lintian.txt)

W: frr source: pkg-js-tools-test-is-missing
W: frr source: pkg-js-tools-test-is-missing
W: frr-doc: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200223-01-g110460327-0 (missing) -> 7.4-dev-20200223-01-g110460327-0~deb10u1
W: frr-pythontools: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200223-01-g110460327-0 (missing) -> 7.4-dev-20200223-01-g110460327-0~deb10u1
W: frr-snmp: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200223-01-g110460327-0 (missing) -> 7.4-dev-20200223-01-g110460327-0~deb10u1
W: frr: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200223-01-g110460327-0 (missing) -> 7.4-dev-20200223-01-g110460327-0~deb10u1
W: frr-rpki-rtrlib: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200223-01-g110460327-0 (missing) -> 7.4-dev-20200223-01-g110460327-0~deb10u1

CLANG Static Analyzer Summary

  • Github Pull Request 5855, comparing to Git base SHA 9a6e190
  • Base image data for Git 9a6e190 does not exist - compare skipped

2 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-10841/artifact/shared/static_analysis/index.html

Copy link
Contributor

@srimohans srimohans left a comment

Choose a reason for hiding this comment

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

Donatas, Is there any other attribute that we treat this way in route maps ? Just an example.

Also, now that this is a string, how to make sure the WORD entered is actually in the range of [0-4294967295], and other numerical validations ?

I will ping you offline for few more questions.

@ton31337
Copy link
Member Author

@srimohans validation is done in route_value_compile().

@riw777 riw777 self-requested a review February 25, 2020 16:42
We already have a generic support for add/sub in route-maps. It's already
handled in route_value_compile().

Just convert to string (allow passing (-) minus sign) - works like expected.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
@LabN-CI
Copy link
Collaborator

LabN-CI commented Feb 28, 2020

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/5855 03252d6
Date 02/28/2020
Start 07:30:28
Finish 07:56:32
Run-Time 26:04
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2020-02-28-07:30:28.txt
Log autoscript-2020-02-28-07:31:24.log.bz2
Memory 494 495 418

For details, please contact louberger

@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-10899/

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.

Warnings Generated during build:

Debian 10 amd64 build: Successful with additional warnings

Debian Package lintian failed for Debian 10 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-10899/artifact/DEB10BUILD/ErrorLog/log_lintian.txt)

W: frr source: pkg-js-tools-test-is-missing
W: frr source: pkg-js-tools-test-is-missing
W: frr-snmp: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200228-02-g03252d603-0 (missing) -> 7.4-dev-20200228-02-g03252d603-0~deb10u1
W: frr-doc: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200228-02-g03252d603-0 (missing) -> 7.4-dev-20200228-02-g03252d603-0~deb10u1
W: frr-rpki-rtrlib: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200228-02-g03252d603-0 (missing) -> 7.4-dev-20200228-02-g03252d603-0~deb10u1
W: frr-pythontools: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200228-02-g03252d603-0 (missing) -> 7.4-dev-20200228-02-g03252d603-0~deb10u1
W: frr: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200228-02-g03252d603-0 (missing) -> 7.4-dev-20200228-02-g03252d603-0~deb10u1

@srimohans
Copy link
Contributor

@riw777 Is there anything pending on this ? I will go ahead and merge this otherwise.

@srimohans srimohans merged commit 200334e into FRRouting:master Mar 2, 2020
@ton31337 ton31337 deleted the fix/allow_using_add_sub_for_local-preference branch March 2, 2020 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bgp documentation tests Topotests, make check, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants