altmp / altv-issues

Issues and roadmap for alt:V project
93 stars 16 forks source link

Bug in IPv4/IPv6 Configuration on Unix. #2354

Open Vaelishaan opened 1 month ago

Vaelishaan commented 1 month ago

Description of the problem

This has aparently occurred a long time ago. But I think that it was never really fixed.

Here is the issue itself in a nutshell. Turn off IPv6 and the server can't check itself or even start itself properly. It says that it does, but you can't connect to it.

For example... Not setting the host variable in the config produces an IPv6 address

[21:52:14] Starting alt:V Server on [::]:7788

Starting the server with

host="0.0.0.0"

produces an IPv6 address

[21:53:23] Starting alt:V Server on [::]:7788

having an ip such as

host="129.168.1.5"

produces

[21:53:23] Starting alt:V Server on 129.168.1.5:7788

The error that is produced is...

[22:19:08][Error] Failed to create host, make sure the host field in the server config is properly configured and the port isn't taken

This is no matter what it is set to.

Enabling IPv6 will allow the server to work and operate correctly, even though IPv6 is completely disabled across the network and cannot traverse the network itself.

I have tested and checked it multiple times. I have disabled and enabled IPv6 many times to make sure that this problem is the exact issue.

Reproduction steps

Disable IPv6.

#!/bin/bash

sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
sysctl -w net.ipv6.conf.eth0.disable_ipv6=1
sysctl -w net.ipv6.conf.lo.disable_ipv6=1
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
nano /etc/default/grub
update-grub
reboot

When editing grub config for generation, set the following...

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
GRUB_CMDLINE_LINUX="ipv6.disable=1"

If you are editing /boot/grub/grub.cfg then just add the "ipv6.disable=0" onto the end of the command lines.

Expected behaviour

I would expect it to just keep running using IPv4.

Additional context

No response

Operating system

Linux (Tested many variants. Initially discovered on Devuan). Have not tested on Windows to see if this is an issue because I don't have an unsafe an insecure Windows Server.

Version

all.

Crashdump ID

No response

Confirmation of issue's presence

ThomasMarangoni commented 1 month ago

If you want to use it in IPv4 only mode, specify an IPv4 interface the server should bind on and not only 0.0.0.0.

Vaelishaan commented 1 month ago

If you want to use it in IPv4 only mode, specify an IPv4 interface the server should bind on and not only 0.0.0.0.

How do I specify an interface then? I do specify an IP Address, and that sets the address, as you read in my bug report. But that doesn't change the outcome. I haven't seen a configuration option to set the interface that it uses though. Would love to hear what that option to set is so that I can test it out and see if that resolves the issue or not.

Thanks.