Skip to content

Commit

Permalink
Merge branch 'master' into aceelindem/ospf-ls-refresh-interval-fix
Browse files Browse the repository at this point in the history
Signed-off-by: Acee Lindem <[email protected]>
  • Loading branch information
aceelindem authored Oct 16, 2024
2 parents a72c898 + 40dce0b commit e543ee7
Show file tree
Hide file tree
Showing 106 changed files with 3,560 additions and 619 deletions.
17 changes: 2 additions & 15 deletions bgpd/bgp_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +480,6 @@ static bool bgp_attr_aigp_get_tlv_metric(uint8_t *pnt, int length,
return false;
}

static uint64_t bgp_aigp_metric_total(struct bgp_path_info *bpi)
{
uint64_t aigp = bgp_attr_get_aigp_metric(bpi->attr);

if (bpi->nexthop)
return aigp + bpi->nexthop->metric;
else
return aigp;
}

static void stream_put_bgp_aigp_tlv_metric(struct stream *s,
struct bgp_path_info *bpi)
{
Expand Down Expand Up @@ -1187,8 +1177,7 @@ struct attr *bgp_attr_aggregate_intern(
SET_FLAG(attr.flag, ATTR_FLAG_BIT(BGP_ATTR_ORIGIN));

/* MED */
attr.med = 0;
SET_FLAG(attr.flag, ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC));
bgp_attr_set_med(&attr, 0);

/* AS path attribute. */
if (aspath)
Expand Down Expand Up @@ -1943,9 +1932,7 @@ static enum bgp_attr_parse_ret bgp_attr_med(struct bgp_attr_parser_args *args)
args->total);
}

attr->med = stream_getl(peer->curr);

SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC));
bgp_attr_set_med(attr, stream_getl(peer->curr));

return BGP_ATTR_PARSE_PROCEED;
}
Expand Down
16 changes: 16 additions & 0 deletions bgpd/bgp_attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,22 @@ static inline void bgp_attr_set_aigp_metric(struct attr *attr, uint64_t aigp)
SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_AIGP));
}

static inline uint64_t bgp_aigp_metric_total(struct bgp_path_info *bpi)
{
uint64_t aigp = bgp_attr_get_aigp_metric(bpi->attr);

if (bpi->nexthop)
return aigp + bpi->nexthop->metric;
else
return aigp;
}

static inline void bgp_attr_set_med(struct attr *attr, uint32_t med)
{
attr->med = med;
SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC));
}

static inline struct cluster_list *bgp_attr_get_cluster(const struct attr *attr)
{
return attr->cluster1;
Expand Down
Loading

0 comments on commit e543ee7

Please sign in to comment.