From 7dff018fd8f44a04b9a88f13887c53ee3a306cb9 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Wed, 31 Jan 2024 17:58:09 +0100 Subject: [PATCH] bgpd: fix special vrf leak label valid Do not consider BGP_PREVENT_VRF_2_VRF_LEAK special label as a valid label. Signed-off-by: Louis Scalbert --- bgpd/bgp_label.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bgpd/bgp_label.h b/bgpd/bgp_label.h index 661e2f6bfb00..7578adb7d14f 100644 --- a/bgpd/bgp_label.h +++ b/bgpd/bgp_label.h @@ -62,6 +62,10 @@ static inline int bgp_is_withdraw_label(mpls_label_t *label) static inline int bgp_is_valid_label(const mpls_label_t *label) { uint8_t *t = (uint8_t *)label; + + if (*label == BGP_PREVENT_VRF_2_VRF_LEAK) + return 0; + if (!t) return 0; return (t[2] & 0x02);