-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 overriding ORIGIN for aggregate-address #5802
bgpd: Allow overriding ORIGIN for aggregate-address #5802
Conversation
There was a problem hiding this 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/48ded0315d68801e11d8fef688628836/raw/88371cc9a827718b28672c6c3e65b597175069e6/cr_5802_1581541008.diff | git apply
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index f7cecb115..6862bb033 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -6867,21 +6867,20 @@ static int bgp_aggregate_set(struct vty *vty, const char *prefix_str, afi_t afi,
return CMD_SUCCESS;
}
-DEFUN (aggregate_address,
- aggregate_address_cmd,
- "aggregate-address A.B.C.D/M [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
- "Configure BGP aggregate entries\n"
- "Aggregate prefix\n"
- "Generate AS set path information\n"
- "Filter more specific routes from updates\n"
- "Filter more specific routes from updates\n"
- "Generate AS set path information\n"
- "Apply route map to aggregate network\n"
- "Name of route map\n"
- "BGP origin code\n"
- "Remote EGP\n"
- "Local IGP\n"
- "Unknown heritage\n")
+DEFUN(aggregate_address, aggregate_address_cmd,
+ "aggregate-address A.B.C.D/M [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
+ "Configure BGP aggregate entries\n"
+ "Aggregate prefix\n"
+ "Generate AS set path information\n"
+ "Filter more specific routes from updates\n"
+ "Filter more specific routes from updates\n"
+ "Generate AS set path information\n"
+ "Apply route map to aggregate network\n"
+ "Name of route map\n"
+ "BGP origin code\n"
+ "Remote EGP\n"
+ "Local IGP\n"
+ "Unknown heritage\n")
{
int idx = 0;
argv_find(argv, argc, "A.B.C.D/M", &idx);
@@ -6914,22 +6913,21 @@ DEFUN (aggregate_address,
summary_only, as_set, origin);
}
-DEFUN (aggregate_address_mask,
- aggregate_address_mask_cmd,
- "aggregate-address A.B.C.D A.B.C.D [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
- "Configure BGP aggregate entries\n"
- "Aggregate address\n"
- "Aggregate mask\n"
- "Generate AS set path information\n"
- "Filter more specific routes from updates\n"
- "Filter more specific routes from updates\n"
- "Generate AS set path information\n"
- "Apply route map to aggregate network\n"
- "Name of route map\n"
- "BGP origin code\n"
- "Remote EGP\n"
- "Local IGP\n"
- "Unknown heritage\n")
+DEFUN(aggregate_address_mask, aggregate_address_mask_cmd,
+ "aggregate-address A.B.C.D A.B.C.D [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
+ "Configure BGP aggregate entries\n"
+ "Aggregate address\n"
+ "Aggregate mask\n"
+ "Generate AS set path information\n"
+ "Filter more specific routes from updates\n"
+ "Filter more specific routes from updates\n"
+ "Generate AS set path information\n"
+ "Apply route map to aggregate network\n"
+ "Name of route map\n"
+ "BGP origin code\n"
+ "Remote EGP\n"
+ "Local IGP\n"
+ "Unknown heritage\n")
{
int idx = 0;
argv_find(argv, argc, "A.B.C.D", &idx);
@@ -6971,22 +6969,21 @@ DEFUN (aggregate_address_mask,
rmap, summary_only, as_set, origin);
}
-DEFUN (no_aggregate_address,
- no_aggregate_address_cmd,
- "no aggregate-address A.B.C.D/M [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
- NO_STR
- "Configure BGP aggregate entries\n"
- "Aggregate prefix\n"
- "Generate AS set path information\n"
- "Filter more specific routes from updates\n"
- "Filter more specific routes from updates\n"
- "Generate AS set path information\n"
- "Apply route map to aggregate network\n"
- "Name of route map\n"
- "BGP origin code\n"
- "Remote EGP\n"
- "Local IGP\n"
- "Unknown heritage\n")
+DEFUN(no_aggregate_address, no_aggregate_address_cmd,
+ "no aggregate-address A.B.C.D/M [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
+ NO_STR
+ "Configure BGP aggregate entries\n"
+ "Aggregate prefix\n"
+ "Generate AS set path information\n"
+ "Filter more specific routes from updates\n"
+ "Filter more specific routes from updates\n"
+ "Generate AS set path information\n"
+ "Apply route map to aggregate network\n"
+ "Name of route map\n"
+ "BGP origin code\n"
+ "Remote EGP\n"
+ "Local IGP\n"
+ "Unknown heritage\n")
{
int idx = 0;
argv_find(argv, argc, "A.B.C.D/M", &idx);
@@ -6994,23 +6991,22 @@ DEFUN (no_aggregate_address,
return bgp_aggregate_unset(vty, prefix, AFI_IP, bgp_node_safi(vty));
}
-DEFUN (no_aggregate_address_mask,
- no_aggregate_address_mask_cmd,
- "no aggregate-address A.B.C.D A.B.C.D [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
- NO_STR
- "Configure BGP aggregate entries\n"
- "Aggregate address\n"
- "Aggregate mask\n"
- "Generate AS set path information\n"
- "Filter more specific routes from updates\n"
- "Filter more specific routes from updates\n"
- "Generate AS set path information\n"
- "Apply route map to aggregate network\n"
- "Name of route map\n"
- "BGP origin code\n"
- "Remote EGP\n"
- "Local IGP\n"
- "Unknown heritage\n")
+DEFUN(no_aggregate_address_mask, no_aggregate_address_mask_cmd,
+ "no aggregate-address A.B.C.D A.B.C.D [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
+ NO_STR
+ "Configure BGP aggregate entries\n"
+ "Aggregate address\n"
+ "Aggregate mask\n"
+ "Generate AS set path information\n"
+ "Filter more specific routes from updates\n"
+ "Filter more specific routes from updates\n"
+ "Generate AS set path information\n"
+ "Apply route map to aggregate network\n"
+ "Name of route map\n"
+ "BGP origin code\n"
+ "Remote EGP\n"
+ "Local IGP\n"
+ "Unknown heritage\n")
{
int idx = 0;
argv_find(argv, argc, "A.B.C.D", &idx);
@@ -7028,21 +7024,20 @@ DEFUN (no_aggregate_address_mask,
return bgp_aggregate_unset(vty, prefix_str, AFI_IP, bgp_node_safi(vty));
}
-DEFUN (ipv6_aggregate_address,
- ipv6_aggregate_address_cmd,
- "aggregate-address X:X::X:X/M [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
- "Configure BGP aggregate entries\n"
- "Aggregate prefix\n"
- "Generate AS set path information\n"
- "Filter more specific routes from updates\n"
- "Filter more specific routes from updates\n"
- "Generate AS set path information\n"
- "Apply route map to aggregate network\n"
- "Name of route map\n"
- "BGP origin code\n"
- "Remote EGP\n"
- "Local IGP\n"
- "Unknown heritage\n")
+DEFUN(ipv6_aggregate_address, ipv6_aggregate_address_cmd,
+ "aggregate-address X:X::X:X/M [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
+ "Configure BGP aggregate entries\n"
+ "Aggregate prefix\n"
+ "Generate AS set path information\n"
+ "Filter more specific routes from updates\n"
+ "Filter more specific routes from updates\n"
+ "Generate AS set path information\n"
+ "Apply route map to aggregate network\n"
+ "Name of route map\n"
+ "BGP origin code\n"
+ "Remote EGP\n"
+ "Local IGP\n"
+ "Unknown heritage\n")
{
int idx = 0;
argv_find(argv, argc, "X:X::X:X/M", &idx);
@@ -7076,22 +7071,21 @@ DEFUN (ipv6_aggregate_address,
sum_only, as_set, origin);
}
-DEFUN (no_ipv6_aggregate_address,
- no_ipv6_aggregate_address_cmd,
- "no aggregate-address X:X::X:X/M [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
- NO_STR
- "Configure BGP aggregate entries\n"
- "Aggregate prefix\n"
- "Generate AS set path information\n"
- "Filter more specific routes from updates\n"
- "Filter more specific routes from updates\n"
- "Generate AS set path information\n"
- "Apply route map to aggregate network\n"
- "Name of route map\n"
- "BGP origin code\n"
- "Remote EGP\n"
- "Local IGP\n"
- "Unknown heritage\n")
+DEFUN(no_ipv6_aggregate_address, no_ipv6_aggregate_address_cmd,
+ "no aggregate-address X:X::X:X/M [<as-set [summary-only]|summary-only [as-set]>] [route-map WORD] [origin <egp|igp|incomplete>]",
+ NO_STR
+ "Configure BGP aggregate entries\n"
+ "Aggregate prefix\n"
+ "Generate AS set path information\n"
+ "Filter more specific routes from updates\n"
+ "Filter more specific routes from updates\n"
+ "Generate AS set path information\n"
+ "Apply route map to aggregate network\n"
+ "Name of route map\n"
+ "BGP origin code\n"
+ "Remote EGP\n"
+ "Local IGP\n"
+ "Unknown heritage\n")
{
int idx = 0;
argv_find(argv, argc, "X:X::X:X/M", &idx);
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 5f0a2d370..5d42f6b1b 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -1489,7 +1489,7 @@ struct bgp_nlri {
#define BGP_ORIGIN_IGP 0
#define BGP_ORIGIN_EGP 1
#define BGP_ORIGIN_INCOMPLETE 2
-#define BGP_ORIGIN_UNSPECIFIED 255
+#define BGP_ORIGIN_UNSPECIFIED 255
/* BGP notify message codes. */
#define BGP_NOTIFY_HEADER_ERR 1
If you are a new contributor to FRR, please see our contributing guidelines.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Override ORIGIN attribute if defined. E.g.: Cisco and Juniper set ORIGIN for aggregated address to IGP which is not what rfc4271 says. This enables the same behavior, optionally. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-10724/ This is a comment from an automated CI system. Warnings Generated during build:Debian 10 amd64 build: Successful with additional warningsDebian Package lintian failed for Debian 10 amd64 build:
clang_check |
Override ORIGIN attribute if defined.
E.g.: Cisco and Juniper set ORIGIN for aggregated address
to IGP which is not what rfc4271 says.
This enables the same behavior, optionally.
Closes #5796