ThunderEX / py-kms

A KMS server written in python.
Other
395 stars 113 forks source link

[IPv6] Error handling when server is ipv4 only #7

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi, On a ipv4-only system (i.e ipv6 has been disabled even if it's available on the LAN) the server throws the following exception :

Traceback (most recent call last):
  File "./server.py", line 126, in <module>
    main()
  File "./server.py", line 68, in main
    socket.inet_pton(socket.AF_INET6, config['ip'])
socket.error: illegal IP address string passed to inet_pton

Command issued : python ./server.py

Server configuration : Slackware 14.1 Python 2.7.13 IP address is a private address from RFC1918 range.

Before the ipv6 commit, everything worked just fine.

Thanks.

ghost commented 7 years ago

It would be nice to have -4 and -6 parameters.

ThunderEX commented 7 years ago

well, this is default server address is 0.0.0.0 and that's just a ipv4 address. to use ipv6 you need to issue: python ./server.py :: so, it just work on ipv4 with ipv4 addr and on ipv6 with ipv6 addr, so that i don't need add additional parameter. if you like, you can help me update README.md to mention this with PR~

ghost commented 7 years ago

I've found a fix.

Can you take a look at my PR ?

I would gladly discuss this issue with you.

Cheers.

ThunderEX commented 7 years ago

Sorry I seemd to misunderstand your issue. Let me have a look at that~