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

Error for default settings #490

Open
qvipin opened this issue Nov 14, 2024 · 5 comments
Open

Error for default settings #490

qvipin opened this issue Nov 14, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@qvipin
Copy link

qvipin commented Nov 14, 2024

Describe The Problem
A suspected bug when trying to include all ipv6 ips in the default settings

Expected Error / Traceback

Please provide the error traceback here

Screenshot 2024-11-13 at 10 51 04 PM

To Reproduce
enter what I had entered

OS Information:

  • Proxmox LXC container using Proxmox VE scripts.
@qvipin qvipin added the bug Something isn't working label Nov 14, 2024
@DaanSelen DaanSelen self-assigned this Nov 14, 2024
@DaanSelen
Copy link
Collaborator

I tried this with the latest code. Could not reproduce.

image

Can you try again? Or how are you running this?

@DaanSelen DaanSelen added question Further information is requested and removed bug Something isn't working labels Nov 15, 2024
@qvipin
Copy link
Author

qvipin commented Nov 15, 2024 via email

@DaanSelen DaanSelen added bug Something isn't working and removed question Further information is requested labels Nov 15, 2024
@DaanSelen
Copy link
Collaborator

Can reproduce.

@DaanSelen DaanSelen assigned donaldzou and unassigned DaanSelen Nov 15, 2024
@NOXCIS
Copy link
Contributor

NOXCIS commented Nov 21, 2024

@donaldzou @DaanSelen

Broken Function

def __configValidation

Source of Problem

if key == "peer_endpoint_allowed_ip":
            value = value.split(",")
            for i in value:
                try:
                    ipaddress.ip_network(i, strict=False)
                except Exception as e:
                    return False, str(e)

Fix

if key == "peer_endpoint_allowed_ip":
            value = value.split(",")
            for i in value:
                i = i.strip()  # Remove leading/trailing whitespace
                try:
                    ipaddress.ip_network(i, strict=False)
                except Exception as e:
                    return False, str(e)

Tested Pass Cases

  • 0.0.0.0/0
  • 0.0.0.0/0, ::/0
  • 0.0.0.0/0, ::/0, 192.168.1.1/24

Tested Fail Cases

  • 0.0.0.0/04s

'0.0.0.0/04s' does not appear to be an IPv4 or IPv6 network

  • 0.0.0.0/0, ::/042s

'::/042s' does not appear to be an IPv4 or IPv6 network

  • 0.0.0.0/0s, ::/042

'0.0.0.0/0s' does not appear to be an IPv4 or IPv6 network

@donaldzou
Copy link
Owner

Hi @NOXCIS, thanks for providing the fix. Will create a PR later to fix this :)

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

No branches or pull requests

4 participants