Skip to content

ipv6_unicast construct error #125

@cs948294549

Description

@cs948294549

nlri_hex += binascii.unhexlify(hex(prefix.ip)[2:])

length of prefix is variable,
nlri_hex += binascii.unhexlify(hex(prefix.ip)[2:math.ceil(prefix.prefixlen / 8)*2+2])
eg.
2001:db8::/40

1 2 3 4 5 6
40 20 01 0d b8 0
1 byte for length, math.ceil(40/8) = 5byte for prefix

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions