Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipv6_unicast construct error #125

Open
cs948294549 opened this issue Sep 23, 2021 · 0 comments
Open

ipv6_unicast construct error #125

cs948294549 opened this issue Sep 23, 2021 · 0 comments
Assignees

Comments

@cs948294549
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants