]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Metric not set with default route.
authorAbhinay Ramesh <rabhinay@vmware.com>
Fri, 18 Feb 2022 07:36:45 +0000 (07:36 +0000)
committerIqra Siddiqui <imujeebsiddi@vmware.com>
Wed, 13 Apr 2022 02:55:54 +0000 (19:55 -0700)
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 <rabhinay@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
bgpd/bgp_updgrp_adv.c

index 0d8ee79ae5bfdb72fcd55e25ed8dcb26b267cd88..87558f9c3554c2d4adefc24f9b4fdbb94ad509ad 100644 (file)
@@ -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. */