Skip to content

Commit

Permalink
RFC4684 (MPLS with other AFI as nexthop) got lost
Browse files Browse the repository at this point in the history
  • Loading branch information
DRiKE committed Dec 20, 2023
1 parent 16ce7da commit 4397eed
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/bgp/message/nlri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,6 @@ impl NextHop {

Ipv4Unicast |
Ipv4Multicast |
Ipv4MplsUnicast |
Ipv4RouteTarget |
L2VpnVpls |
L2VpnEvpn
Expand All @@ -690,14 +689,21 @@ impl NextHop {
_ => error!()
}
}
Ipv6Multicast |
Ipv6MplsUnicast
=> {
Ipv6Multicast => {
match len {
16 => NextHop::Unicast(parse_ipv6addr(parser)?.into()),
_ => error!()
}
}
// RFC4684: the nexthop for MPLS can be of the other AFI than the
// NLRI themselves are.
Ipv4MplsUnicast | Ipv6MplsUnicast => {
match len {
4 => NextHop::Unicast(parse_ipv4addr(parser)?.into()),
16 => NextHop::Unicast(parse_ipv6addr(parser)?.into()),
_ => error!()
}
}
Ipv4MplsVpnUnicast => {
match len {
12 => NextHop::MplsVpnUnicast(
Expand Down

0 comments on commit 4397eed

Please sign in to comment.