scapy
scapy copied to clipboard
fix LDP FecTLVField
The FEC TLV was malformed for all prefixes with length less or equal 24.

According to RFC5036, an address prefix is encoded according to the address family field, whose length, in bits, was specified in the prefix length field, padded to a byte boundary.
https://www.rfc-editor.org/rfc/rfc5036.html#section-3.4.1
This was already done correctly in the corresponding decode but wrong in encode function.
I tested and monkey patched this in one of my open source projects shown here: https://github.com/rtbrick/bngblaster/blob/dev/code/ldpupdate#L31
With fix:
Hi ! Thanks for the PR. Could you add a unit test to https://github.com/secdev/scapy/blob/master/test/contrib/ldp.uts ? Thanks !
Closing for inactivity.