Skip to content

Fix for subnets#1929

Merged
dgibbs64 merged 1 commit intoGameServerManagers:developfrom
T1MOXA:master
Jul 18, 2018
Merged

Fix for subnets#1929
dgibbs64 merged 1 commit intoGameServerManagers:developfrom
T1MOXA:master

Conversation

@T1MOXA
Copy link
Copy Markdown
Contributor

@T1MOXA T1MOXA commented Jul 4, 2018

No description provided.

@request-info
Copy link
Copy Markdown

request-info Bot commented Jul 4, 2018

The maintainers of this repository would appreciate it if you could provide more information.

@ghost ghost added the Status: dev queue label Jul 4, 2018
@T1MOXA
Copy link
Copy Markdown
Contributor Author

T1MOXA commented Jul 4, 2018

An example of my configuration:

server@user:~$ ip -o -4 addr
1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
2: enp3s0    inet 11.11.22.11/24 brd 11.11.22.255 scope global enp3s0\       valid_lft forever preferred_lft forever
2: enp3s0    inet 11.11.22.11 peer 22.22.22.1/32 brd 11.11.22.11 scope global enp3s0\       valid_lft forever preferred_lft forever

@dgibbs64 dgibbs64 changed the base branch from master to develop July 17, 2018 19:54
@dgibbs64
Copy link
Copy Markdown
Member

@T1MOXA please can you describe why this change is required. I'm sure its probably correct but I don't fully understand it.

@T1MOXA
Copy link
Copy Markdown
Contributor Author

T1MOXA commented Jul 17, 2018

server@user:~$ ip -o -4 addr
1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
2: enp3s0    inet 11.11.22.11/24 brd 11.11.22.255 scope global enp3s0\       valid_lft forever preferred_lft forever
2: enp3s0    inet 11.11.22.11 peer 22.22.22.1/32 brd 11.11.22.11 scope global enp3s0\       valid_lft forever preferred_lft forever

ip -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0 return 2
And server doesn't start.

ip -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|sort -u|grep -v 127.0.0 return 11.11.22.11
And the server starts normally.

@UltimateByte
Copy link
Copy Markdown
Contributor

In my case, (with docker installed which explains the 172.17.X.X IP) on a CentOS VM:

# ip -o -4 addr
1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
2: eth0    inet 154.41.xxx
xxx/23 brd 154.41.67.255 scope global eth0\       valid_lft forever preferred_lft forever
3: docker0    inet 172.17.0.1/16 scope global docker0\       valid_lft forever preferred_lft forever

Original code output:

# ip -o -4 addr| awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0
154.41.xxx.xxx
172.17.0.1
# ip -o -4 addr| awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -vc 127.0.0
2

New code output:

# ip -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|sort -u|grep -v 127.0.0
154.41.xxx.xxx
172.17.0.1
# ip -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|sort -u|grep -vc 127.0.0
2

Got the same kind of output on my Debian machine (which has a dozen IP), so no issue in the first place. Could possibly your original issue come from the fact that you have two times the same IP displayed in ip -o -4 addr, but the second occurrence doesn't have the mask in it?

Any case, your PR doesn't seem to hurt, except we like to add spaces between pipes | for clarity but this doesn't affect code execution.

@dgibbs64 dgibbs64 merged commit 39304fb into GameServerManagers:develop Jul 18, 2018
@ghost ghost removed the Status: dev queue label Jul 18, 2018
@dgibbs64 dgibbs64 added the outcome: pr accepted Pull Request accepted label Jul 21, 2018
@lock
Copy link
Copy Markdown

lock Bot commented Jul 21, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked and limited conversation to collaborators Jul 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outcome: pr accepted Pull Request accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants