scapy icon indicating copy to clipboard operation
scapy copied to clipboard

fix LDP FecTLVField

Open GIC-de opened this issue 2 years ago • 1 comments

The FEC TLV was malformed for all prefixes with length less or equal 24.

image

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: image

GIC-de avatar Jan 05 '23 21:01 GIC-de

Hi ! Thanks for the PR. Could you add a unit test to https://github.com/secdev/scapy/blob/master/test/contrib/ldp.uts ? Thanks !

gpotter2 avatar Jan 31 '23 21:01 gpotter2

Closing for inactivity.

gpotter2 avatar Apr 21 '24 00:04 gpotter2