Skip to content

Commit

Permalink
actually support VPN routes with Add-Paths
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyuyureka committed Jan 22, 2025
1 parent 5314a24 commit 0dc6577
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,26 @@ fn bgp_addrs_to_nets(
bgpv6addr_to_ipnet(addr).map(|net| (RouteDistinguisher::Default, 0, net))
})
.collect(),
BgpAddrs::VPNV4UP(ref addrs) => addrs
.iter()
.filter_map(|addr| {
let WithPathId { pathid, nlri } = addr;
let rd = RouteDistinguisher::try_from(nlri.prefix.rd.clone())
.inspect_err(|_| warn!("invalid Bgp Route distinguisher"))
.ok()?;
bgpv4addr_to_ipnet(&nlri.prefix.prefix).map(|net| (rd, *pathid, net))
})
.collect(),
BgpAddrs::VPNV6UP(ref addrs) => addrs
.iter()
.filter_map(|addr| {
let WithPathId { pathid, nlri } = addr;
let rd = RouteDistinguisher::try_from(nlri.prefix.rd.clone())
.inspect_err(|_| warn!("invalid Bgp Route distinguisher"))
.ok()?;
bgpv6addr_to_ipnet(&nlri.prefix.prefix).map(|net| (rd, *pathid, net))
})
.collect(),
BgpAddrs::VPNV4U(ref addrs) => addrs
.iter()
.filter_map(|labeled| {
Expand Down

0 comments on commit 0dc6577

Please sign in to comment.