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

[Bug]: Validation for IPv6 doesn't work #464

Closed
1 of 2 tasks
WGOS opened this issue Aug 2, 2024 · 4 comments · Fixed by #465
Closed
1 of 2 tasks

[Bug]: Validation for IPv6 doesn't work #464

WGOS opened this issue Aug 2, 2024 · 4 comments · Fixed by #465
Labels
bug Something isn't working pinned Does not stale

Comments

@WGOS
Copy link
Contributor

WGOS commented Aug 2, 2024

🐛 Describe the Bug

I am unable to add or remove IPv6 addresses or routes from Managed Routes or IP Assignment menus though this is clearly a supported feature when interacting with controller via API.

It's also impossible to delete any routes (including IPv4) if there are IPv6 routes presented

🔍 Steps to Reproduce

Managed routes

  1. Go to menu
  2. Click a "plus" sign
  3. Enter a IPv6 route
  4. Click Add

IP assignments

  1. Go to menu
  2. Click Advanced
  3. Add a IPv6 range
  4. Click Submit

🔧 Deployment Type

  • Docker
  • Standalone

✨ Expected Behavior

Both of those menus should validate IPv6 successfully as it is supported by ZeroTier Central, ZeroTier Controller API and ztcui where I migrated from

📋 ZTNET Logs

No response

🖼 Screenshots

The error I get when interacting with menus
image

@WGOS WGOS added the bug Something isn't working label Aug 2, 2024
@sinamics sinamics added the pinned Does not stale label Aug 2, 2024
@WGOS
Copy link
Contributor Author

WGOS commented Aug 2, 2024

Apparently it seems to be the issue with this method

I do think this is caused by a lack of distinction between v4 and v6 at lines 97 and 98. The variable is set by the same method for both addresses, which will return true if the address is v4 or v6. So, if the address is v4 or v6, the method will always go for the branch if(isIPv4) at line 101 and check prefixNumber as if it was v4, even if an IPv6 CIDR is supplied

@WGOS
Copy link
Contributor Author

WGOS commented Aug 2, 2024

Just tested #465 and it works just fine in both menus

@WGOS
Copy link
Contributor Author

WGOS commented Aug 2, 2024

This should also help with #463

@sinamics
Copy link
Owner

sinamics commented Aug 2, 2024

You are absolutely right, the previous code did not work as intended.
Thank you for the PR, it looks fine to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pinned Does not stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants