mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 14:34:22 +00:00
bgpd: when nexthop IP is available for flowspec, keep it
keep original nexthop IP address when propagating bgp updates to other peers. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
e164eb7012
commit
211ee7aa63
@ -2970,6 +2970,8 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi,
|
|||||||
safi == SAFI_LABELED_UNICAST ||
|
safi == SAFI_LABELED_UNICAST ||
|
||||||
safi == SAFI_MULTICAST))
|
safi == SAFI_MULTICAST))
|
||||||
nh_afi = peer_cap_enhe(peer, afi, safi) ? AFI_IP6 : AFI_IP;
|
nh_afi = peer_cap_enhe(peer, afi, safi) ? AFI_IP6 : AFI_IP;
|
||||||
|
else if (safi == SAFI_FLOWSPEC)
|
||||||
|
nh_afi = afi;
|
||||||
else
|
else
|
||||||
nh_afi = BGP_NEXTHOP_AFI_FROM_NHLEN(attr->mp_nexthop_len);
|
nh_afi = BGP_NEXTHOP_AFI_FROM_NHLEN(attr->mp_nexthop_len);
|
||||||
|
|
||||||
@ -2996,7 +2998,12 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi,
|
|||||||
stream_put(s, &attr->mp_nexthop_global_in, 4);
|
stream_put(s, &attr->mp_nexthop_global_in, 4);
|
||||||
break;
|
break;
|
||||||
case SAFI_FLOWSPEC:
|
case SAFI_FLOWSPEC:
|
||||||
stream_putc(s, 0); /* no nexthop for flowspec */
|
if (attr->mp_nexthop_len == 0)
|
||||||
|
stream_putc(s, 0); /* no nexthop for flowspec */
|
||||||
|
else {
|
||||||
|
stream_putc(s, attr->mp_nexthop_len);
|
||||||
|
stream_put_ipv4(s, attr->nexthop.s_addr);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user