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

Fix IPv6 random IP logic error #3232

Merged
merged 2 commits into from
Apr 6, 2024
Merged

Fix IPv6 random IP logic error #3232

merged 2 commits into from
Apr 6, 2024

Conversation

ImAubrey
Copy link
Contributor

@ImAubrey ImAubrey commented Apr 5, 2024

Optimize the random IP algorithm logic and fix the problem of random IP errors when the prefix is not divisible by 8.

@Fangliding
Copy link
Member

Fangliding commented Apr 5, 2024

Very grateful
I did think of the situation of the prefix might not divisible by 8 and put it on the schedule, but I forgot it in the end😂

@ImAubrey
Copy link
Contributor Author

ImAubrey commented Apr 5, 2024

Very grateful I did think of the situation of the prefix might not divisible by 8 and put it on the schedule, but I forgot it in the end😂

I came across the update in version 1.8.10 by chance and started using it. Yesterday, I had my own IPv6 Prefix, but my announce was /47. At first, when I filled in /47, I thought it was a problem with my network. It was only after examining the code that I realized this minor issue.

Additionally, in my opinion, converting the IP address and prefix directly into a range, then randomly generating a number within this range, and finally converting this number back to an IP address might be more efficient.

Ha, no worries at all! Glad I could help!

@yuhan6665 yuhan6665 merged commit 8374d59 into XTLS:main Apr 6, 2024
34 checks passed
@yuhan6665
Copy link
Member

looks great!

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

Successfully merging this pull request may close these issues.

3 participants