mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 01:15:12 +00:00
Revert "bgpd: Make sure default-originate works without route-map as well"
This reverts commit c2e1042203
.
This commit is contained in:
parent
73c497e409
commit
4cf3d2e06d
@ -662,7 +662,6 @@ void subgroup_announce_route(struct update_subgroup *subgrp)
|
|||||||
void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
|
void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
|
||||||
{
|
{
|
||||||
struct bgp *bgp;
|
struct bgp *bgp;
|
||||||
struct attr attr;
|
|
||||||
struct bgp_info *info, init_info, tmp_info;
|
struct bgp_info *info, init_info, tmp_info;
|
||||||
struct prefix p;
|
struct prefix p;
|
||||||
struct peer *from;
|
struct peer *from;
|
||||||
@ -686,23 +685,8 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
|
|||||||
bgp = peer->bgp;
|
bgp = peer->bgp;
|
||||||
from = bgp->peer_self;
|
from = bgp->peer_self;
|
||||||
|
|
||||||
bgp_attr_default_set(&attr, BGP_ORIGIN_IGP);
|
init_info.attr = NULL;
|
||||||
attr.local_pref = bgp->default_local_pref;
|
|
||||||
|
|
||||||
if ((afi == AFI_IP6) || peer_cap_enhe(peer, afi, safi)) {
|
|
||||||
/* IPv6 global nexthop must be included.
|
|
||||||
*/
|
|
||||||
attr.mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL;
|
|
||||||
|
|
||||||
/* If the peer is on shared nextwork and
|
|
||||||
* we have link-local nexthop set it. */
|
|
||||||
if (peer->shared_network
|
|
||||||
&& !IN6_IS_ADDR_UNSPECIFIED(&peer->nexthop.v6_local))
|
|
||||||
attr.mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL;
|
|
||||||
}
|
|
||||||
init_info.attr = &attr;
|
|
||||||
info = &init_info;
|
info = &init_info;
|
||||||
bgp_attr_intern(info->attr);
|
|
||||||
|
|
||||||
memset(&p, 0, sizeof(p));
|
memset(&p, 0, sizeof(p));
|
||||||
p.family = afi2family(afi);
|
p.family = afi2family(afi);
|
||||||
@ -723,9 +707,13 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
|
|||||||
|
|
||||||
if ((afi == AFI_IP6)
|
if ((afi == AFI_IP6)
|
||||||
|| peer_cap_enhe(peer, afi, safi)) {
|
|| peer_cap_enhe(peer, afi, safi)) {
|
||||||
|
/* IPv6 global nexthop must be included.
|
||||||
|
*/
|
||||||
tmp_info.attr->mp_nexthop_len =
|
tmp_info.attr->mp_nexthop_len =
|
||||||
BGP_ATTR_NHLEN_IPV6_GLOBAL;
|
BGP_ATTR_NHLEN_IPV6_GLOBAL;
|
||||||
|
|
||||||
|
/* If the peer is on shared nextwork and
|
||||||
|
* we have link-local nexthop set it. */
|
||||||
if (peer->shared_network
|
if (peer->shared_network
|
||||||
&& !IN6_IS_ADDR_UNSPECIFIED(
|
&& !IN6_IS_ADDR_UNSPECIFIED(
|
||||||
&peer->nexthop.v6_local))
|
&peer->nexthop.v6_local))
|
||||||
@ -738,7 +726,6 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
|
|||||||
&rn->p, RMAP_BGP, &tmp_info);
|
&rn->p, RMAP_BGP, &tmp_info);
|
||||||
|
|
||||||
info = &tmp_info;
|
info = &tmp_info;
|
||||||
bgp_attr_intern(info->attr);
|
|
||||||
|
|
||||||
if (ret != RMAP_DENYMATCH)
|
if (ret != RMAP_DENYMATCH)
|
||||||
break;
|
break;
|
||||||
@ -787,7 +774,6 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
|
|||||||
BGP_ADDPATH_TX_ID_FOR_DEFAULT_ORIGINATE);
|
BGP_ADDPATH_TX_ID_FOR_DEFAULT_ORIGINATE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aspath_unintern(&info->attr->aspath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user