Commit c7bbb8b608 for frr

commit c7bbb8b608b51f9d0bc790988293cf183ac8ff85
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date:   Thu Nov 26 16:51:08 2026 +0100

    bgpd: log VPN routes not imported because of the AS path

    When a VPN route is not imported into a VRF because its AS path contains
    the AS of this VRF, nothing is logged with "debug bgp vpn leak-to-vrf",
    unless a path already imported is removed. On reception, an AS path loop
    is logged with "debug bgp updates in".

    vpn_leak_to_vrf_update_onevrf() returns silently in this case.

    Log the RD, the prefix, the VRF, its AS and the allowas-in value used.

    Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>

diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index ba3616b32e..6d4314b0af 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -2522,6 +2522,10 @@ static void vpn_leak_to_vrf_update_onevrf(struct bgp *to_bgp,	/* to */
 		aspath_loop_count = to_bgp->vpn_policy[afi].import_allowas_in;

 	if (aspath_loop_check(path_vpn->attr->aspath, to_bgp->as) > aspath_loop_count) {
+		if (debug)
+			zlog_debug("%s: skipping import of RD %s, %pFX to %s, as-path contains AS %s (allowas-in %d)",
+				   __func__, rd_buf, p, to_bgp->name_pretty, to_bgp->as_pretty,
+				   aspath_loop_count);
 		for (bpi = bgp_dest_get_bgp_path_info(bn); bpi;
 		     bpi = bpi->next) {
 			if (!bpi->extra || !bpi->extra->vrfleak ||