From f78cfba9c9746534855c5739bb90d48c6ed9e0d1 Mon Sep 17 00:00:00 2001 From: Abhinay Ramesh Date: Fri, 18 Feb 2022 07:36:45 +0000 Subject: [PATCH] bgpd: Metric not set with default route. Description: - When default route is originated using the neighbor default-originate command, MED is not set as part of the update message attribute. - Changes are done to set the MED value and MED flag for default route. Co-authored-by: Abhinay Ramesh Signed-off-by: Iqra Siddiqui --- bgpd/bgp_updgrp_adv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index 0d8ee79ae5..87558f9c35 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -818,6 +818,8 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) assert(attr.aspath); attr.local_pref = bgp->default_local_pref; + attr.med = 0; + attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC); if ((afi == AFI_IP6) || peer_cap_enhe(peer, afi, safi)) { /* IPv6 global nexthop must be included. */