mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 03:47:47 +00:00
bgpd: fix populating the attribute
This code is populating a temporary variable `add` instead of the attr.
Initially this variable was later copied to the attr but the copying was
erroneously deleted by 0a50c2481
. Directly populate the attr to restore
the correct behavior.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
8f2661b01d
commit
b04c1e9997
@ -6072,7 +6072,6 @@ static void bgp_static_update_safi(struct bgp *bgp, const struct prefix *p,
|
|||||||
mpls_label_t label = 0;
|
mpls_label_t label = 0;
|
||||||
#endif
|
#endif
|
||||||
uint32_t num_labels = 0;
|
uint32_t num_labels = 0;
|
||||||
union gw_addr add;
|
|
||||||
|
|
||||||
assert(bgp_static);
|
assert(bgp_static);
|
||||||
|
|
||||||
@ -6095,12 +6094,17 @@ static void bgp_static_update_safi(struct bgp *bgp, const struct prefix *p,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (afi == AFI_L2VPN) {
|
if (afi == AFI_L2VPN) {
|
||||||
if (bgp_static->gatewayIp.family == AF_INET)
|
if (bgp_static->gatewayIp.family == AF_INET) {
|
||||||
add.ipv4.s_addr =
|
SET_IPADDR_V4(&attr.evpn_overlay.gw_ip);
|
||||||
bgp_static->gatewayIp.u.prefix4.s_addr;
|
memcpy(&attr.evpn_overlay.gw_ip.ipaddr_v4,
|
||||||
else if (bgp_static->gatewayIp.family == AF_INET6)
|
&bgp_static->gatewayIp.u.prefix4,
|
||||||
memcpy(&(add.ipv6), &(bgp_static->gatewayIp.u.prefix6),
|
IPV4_MAX_BYTELEN);
|
||||||
sizeof(struct in6_addr));
|
} else if (bgp_static->gatewayIp.family == AF_INET6) {
|
||||||
|
SET_IPADDR_V6(&attr.evpn_overlay.gw_ip);
|
||||||
|
memcpy(&attr.evpn_overlay.gw_ip.ipaddr_v6,
|
||||||
|
&bgp_static->gatewayIp.u.prefix6,
|
||||||
|
IPV6_MAX_BYTELEN);
|
||||||
|
}
|
||||||
memcpy(&attr.esi, bgp_static->eth_s_id, sizeof(esi_t));
|
memcpy(&attr.esi, bgp_static->eth_s_id, sizeof(esi_t));
|
||||||
if (bgp_static->encap_tunneltype == BGP_ENCAP_TYPE_VXLAN) {
|
if (bgp_static->encap_tunneltype == BGP_ENCAP_TYPE_VXLAN) {
|
||||||
struct bgp_encap_type_vxlan bet;
|
struct bgp_encap_type_vxlan bet;
|
||||||
|
Loading…
Reference in New Issue
Block a user