summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2025-04-01 10:25:27 -0400
committerGitHub <noreply@github.com>2025-04-01 10:25:27 -0400
commit6fcdc14e3a5563fb446387ea11765d7402d6a6d9 (patch)
tree795554f3011186c0aac0920e634eda6150b46e90
parentb70bb46cf9fd73791f349c9281b004e3ad61dbf0 (diff)
parent9a0f5a080972b3c1546254d457e553527784cf86 (diff)
Merge pull request #18527 from FRRouting/mergify/bp/stable/10.3/pr-18502
bgpd: Set the label for MP_UNREACH_NLRI 0x800000 instead of 0x000000 (backport #18502)
-rw-r--r--bgpd/bgp_attr.c8
-rw-r--r--bgpd/bgp_label.h2
-rw-r--r--tests/topotests/bgp_bmp/bmp1/bmp-withdraw-loc-rib-step2.json4
-rw-r--r--tests/topotests/bgp_bmp/bmp1/bmp-withdraw-post-policy-step2.json4
-rw-r--r--tests/topotests/bgp_bmp/bmp1/bmp-withdraw-pre-policy-step2.json4
-rw-r--r--tests/topotests/bgp_bmp/bmp1import/bmp-withdraw-loc-rib-step2.json4
6 files changed, 15 insertions, 11 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index d349922c52..e5dc558fcf 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -5023,7 +5023,13 @@ void bgp_packet_mpunreach_prefix(struct stream *s, const struct prefix *p,
{
uint8_t wlabel[4] = {0x80, 0x00, 0x00};
- if (safi == SAFI_LABELED_UNICAST) {
+ /* [RFC3107] also made it possible to withdraw a binding without
+ * specifying the label explicitly, by setting the Compatibility field
+ * to 0x800000. However, some implementations set it to 0x000000. In
+ * order to ensure backwards compatibility, it is RECOMMENDED by this
+ * document that the Compatibility field be set to 0x800000.
+ */
+ if (safi == SAFI_LABELED_UNICAST || safi == SAFI_MPLS_VPN) {
label = (mpls_label_t *)wlabel;
num_labels = 1;
}
diff --git a/bgpd/bgp_label.h b/bgpd/bgp_label.h
index 2ffd5b699d..ff002c2071 100644
--- a/bgpd/bgp_label.h
+++ b/bgpd/bgp_label.h
@@ -7,8 +7,6 @@
#define _BGP_LABEL_H
#define BGP_LABEL_BYTES 3
-#define BGP_LABEL_BITS 24
-#define BGP_WITHDRAW_LABEL 0x800000
#define BGP_PREVENT_VRF_2_VRF_LEAK 0xFFFFFFFE
struct bgp_dest;
diff --git a/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-loc-rib-step2.json b/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-loc-rib-step2.json
index 1e5040ba60..20510a1e00 100644
--- a/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-loc-rib-step2.json
+++ b/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-loc-rib-step2.json
@@ -6,7 +6,7 @@
"bmp_log_type": "withdraw",
"ip_prefix": "172.31.0.15/32",
"is_filtered": false,
- "label": 0,
+ "label": 524288,
"peer_asn": 65501,
"peer_bgp_id": "192.168.0.1",
"peer_distinguisher": "0:0",
@@ -20,7 +20,7 @@
"bmp_log_type": "withdraw",
"ip_prefix": "2001::1111/128",
"is_filtered": false,
- "label": 0,
+ "label": 524288,
"peer_asn": 65501,
"peer_bgp_id": "192.168.0.1",
"peer_distinguisher": "0:0",
diff --git a/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-post-policy-step2.json b/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-post-policy-step2.json
index 9eb221d4d0..a34a0005e7 100644
--- a/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-post-policy-step2.json
+++ b/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-post-policy-step2.json
@@ -6,7 +6,7 @@
"bmp_log_type": "withdraw",
"ip_prefix": "2001::1111/128",
"ipv6": true,
- "label": 0,
+ "label": 524288,
"peer_asn": 65502,
"peer_bgp_id": "192.168.0.2",
"peer_distinguisher": "0:0",
@@ -21,7 +21,7 @@
"bmp_log_type": "withdraw",
"ip_prefix": "172.31.0.15/32",
"ipv6": false,
- "label": 0,
+ "label": 524288,
"peer_asn": 65502,
"peer_bgp_id": "192.168.0.2",
"peer_distinguisher": "0:0",
diff --git a/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-pre-policy-step2.json b/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-pre-policy-step2.json
index eea7501b22..92b8f52517 100644
--- a/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-pre-policy-step2.json
+++ b/tests/topotests/bgp_bmp/bmp1/bmp-withdraw-pre-policy-step2.json
@@ -6,7 +6,7 @@
"bmp_log_type": "withdraw",
"ip_prefix": "2001::1111/128",
"ipv6": true,
- "label": 0,
+ "label": 524288,
"peer_asn": 65502,
"peer_bgp_id": "192.168.0.2",
"peer_distinguisher": "0:0",
@@ -21,7 +21,7 @@
"bmp_log_type": "withdraw",
"ip_prefix": "172.31.0.15/32",
"ipv6": false,
- "label": 0,
+ "label": 524288,
"peer_asn": 65502,
"peer_bgp_id": "192.168.0.2",
"peer_distinguisher": "0:0",
diff --git a/tests/topotests/bgp_bmp/bmp1import/bmp-withdraw-loc-rib-step2.json b/tests/topotests/bgp_bmp/bmp1import/bmp-withdraw-loc-rib-step2.json
index 1e5040ba60..20510a1e00 100644
--- a/tests/topotests/bgp_bmp/bmp1import/bmp-withdraw-loc-rib-step2.json
+++ b/tests/topotests/bgp_bmp/bmp1import/bmp-withdraw-loc-rib-step2.json
@@ -6,7 +6,7 @@
"bmp_log_type": "withdraw",
"ip_prefix": "172.31.0.15/32",
"is_filtered": false,
- "label": 0,
+ "label": 524288,
"peer_asn": 65501,
"peer_bgp_id": "192.168.0.1",
"peer_distinguisher": "0:0",
@@ -20,7 +20,7 @@
"bmp_log_type": "withdraw",
"ip_prefix": "2001::1111/128",
"is_filtered": false,
- "label": 0,
+ "label": 524288,
"peer_asn": 65501,
"peer_bgp_id": "192.168.0.1",
"peer_distinguisher": "0:0",