Closed Tuetuopay closed 7 months ago
Hi! Could you please chane Mac method names to something like: from -> from_network_bytes write_to -> write_to_network_byte
Hi, sure! However this still surprises me because MAC addresses don't have the notion of byte ordering, as they're stored on the wire the same way they are everywhere else: it's a byte array, not a word compounded of multiple bytes with endianess.
As it is right now, i'll do it, but this makes the structure be the opposite of what's expected. E.G. the MAC aa:bb:cc:dd:ee:ff
will be stored as MacAddress { mac_address: [0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa] }
which is highly unexpected.
Done.
The MAC address is stored in reverse order from what it is on the wire; leading to a bad serialization when encoding back routes that were decoded from an actual bgp peer.
Fixes: 268ecb9 ("First release")
As a side note, why on earth are MAC addresses stored in reverse order? They are a sequence of bytes, not a compound number, thus there is no notion of "network byte order". Bytes are on the same order everywhere.
Thanks!