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 not supported #6

Open
lahdekorpi opened this issue Oct 22, 2017 · 1 comment
Open

IPv6 not supported #6

lahdekorpi opened this issue Oct 22, 2017 · 1 comment

Comments

@lahdekorpi
Copy link

     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1843, in call
                  **cdata['kwargs'])
                File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1795, in wrapper
                  return f(*args, **kwargs)
                File "/var/cache/salt/minion/extmods/states/ufw.py", line 85, in allowed
                  from_addr=from_addr, from_port=from_port, to_addr=to_addr, to_port=to_port)
                File "/var/cache/salt/minion/extmods/states/ufw.py", line 45, in _as_rule
                  cmd.append(_resolve(from_addr))
                File "/var/cache/salt/minion/extmods/states/ufw.py", line 27, in _resolve
                  return socket.gethostbyname(host)
              gaierror: [Errno -9] Address family for hostname not supported

IPv6 addresses are getting resolved via socket.gethostbyname(host) causing a failure.

@lahdekorpi
Copy link
Author

The regex also returns an empty value (if it would work).

A workaround for this is to disable the gethostbyname for now and the regex, and just return the host as is. Using the gethostbyname like this is also ill-advised as it returns an IPv4 address, not both.

My suggestion would be to completely disable host resolutions and pass everything to UFW as is.

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

1 participant