wladwm / zettabgp

BGP & BMP Rust library
MIT License
13 stars 5 forks source link

Fix esi serialization #18

Closed Tuetuopay closed 7 months ago

Tuetuopay commented 7 months ago

This PR fixes my past PR adding serialization support for EVPN types.

In the previous PR, I missed that EVPNESI only contained the ESI data, and not the type byte. This made the length check fail on updates that were decoded from BGP instead of manually crafted (my usecase at the time).

To avoid further confusion, this PR also adds a layer of safety by switching to a fixed-size array instead of a plain unsized array.