From 6b9ce3dc81435e7ce89010ae7e6a50bb6c64ad60 Mon Sep 17 00:00:00 2001 From: v00lk Date: Sat, 16 Nov 2019 10:22:01 +0300 Subject: [PATCH] bgpd: IPv4 LU withdraw using 0x000000 label According to RFC 8277 IPv4 LU NLRI can be withdrawn using label 0x000000. This RFC updates RFC3101 where it should be done only with 0x800000 label value. Juniper implementation sets value 0x000000 when prefix is being withdrawn. Page 12 RFC8277 states: [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, but it is REQUIRED that it be ignored upon reception. Now FRR drops BGP session when receives such BGP update. Signed-off-by: Aleksandr Klimenko --- bgpd/bgp_label.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_label.h b/bgpd/bgp_label.h index 89bc9aabb0..523671468b 100644 --- a/bgpd/bgp_label.h +++ b/bgpd/bgp_label.h @@ -58,7 +58,7 @@ static inline int bgp_is_withdraw_label(mpls_label_t *label) /* The check on pkt[2] for 0x00 or 0x02 is in case bgp_set_valid_label() * was called on the withdraw label */ - if ((pkt[0] == 0x80) && (pkt[1] == 0x00) + if (((pkt[0] == 0x80) || (pkt[0] == 0x00)) && (pkt[1] == 0x00) && ((pkt[2] == 0x00) || (pkt[2] == 0x02))) return 1; return 0;