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

add subnet mask to interface address #332

Closed
wants to merge 2 commits into from

Conversation

realies
Copy link

@realies realies commented Apr 24, 2024

fixes #330

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

@LinuxServer-CI
Copy link
Contributor

I am a bot, here is the pushed image/manifest for this PR:

ghcr.io/linuxserver/lspipepr-wireguard:v1.0.20210914-pkg-d0ce8898-dev-cfbe30213da58c37b38f8251e24d6a58576699da-pr-332

@LinuxServer-CI
Copy link
Contributor

I am a bot, here is the pushed image/manifest for this PR:

ghcr.io/linuxserver/lspipepr-wireguard:v1.0.20210914-pkg-d0ce8898-dev-545474e139305c6ae42e00ea525277c8ad221e9d-pr-332

@LinuxServer-CI
Copy link
Contributor

I am a bot, here is the pushed image/manifest for this PR:

ghcr.io/linuxserver/lspipepr-wireguard:v1.0.20210914-pkg-d0ce8898-dev-86cf9692fea05d6c8a577526f3dc8cd0fb9bf50c-pr-332

@LinuxServer-CI
Copy link
Contributor

I am a bot, here is the pushed image/manifest for this PR:

ghcr.io/linuxserver/lspipepr-wireguard:v1.0.20210914-pkg-cac0c587-dev-27f231db995212a213a93d8c03583cd4ed4cef85-pr-332

@thespad
Copy link
Member

thespad commented May 24, 2024

An immediate concern I can see with this is that applying it to an existing install would result in duplicate IP addresses being allocated as f/ex 10.10.13.2/32 would not exist in any current peer conf and would therefore be acceptable to assign to a new peer, even if there was already one with 10.10.13.2 allocated.

Comment on lines +59 to +60
PROPOSED_IP="${INTERFACE}.${idx}/32"
if ! grep -q -R "${PROPOSED_IP}" /config/peer*/*.conf 2>/dev/null && ([[ -z "${ORIG_INTERFACE}" ]] || ! grep -q -R "${ORIG_INTERFACE}.${idx}/32" /config/peer*/*.conf 2>/dev/null); then
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thespad, is something like this going to be better? If not, do you have any suggestions?

Suggested change
PROPOSED_IP="${INTERFACE}.${idx}/32"
if ! grep -q -R "${PROPOSED_IP}" /config/peer*/*.conf 2>/dev/null && ([[ -z "${ORIG_INTERFACE}" ]] || ! grep -q -R "${ORIG_INTERFACE}.${idx}/32" /config/peer*/*.conf 2>/dev/null); then
for idx in {2..254}; do
PROPOSED_IP="${INTERFACE}.${idx}/32"
if ! grep -q -R "${INTERFACE}.${idx}" /config/peer*/*.conf 2>/dev/null &&
! grep -q -R "${INTERFACE}.${idx}/32" /config/peer*/*.conf 2>/dev/null &&
([[ -z "${ORIG_INTERFACE}" ]] ||
(! grep -q -R "${ORIG_INTERFACE}.${idx}" /config/peer*/*.conf 2>/dev/null &&
! grep -q -R "${ORIG_INTERFACE}.${idx}/32" /config/peer*/*.conf 2>/dev/null)); then
CLIENT_IP="${PROPOSED_IP}"
break
fi
done

@LinuxServer-CI
Copy link
Contributor

I am a bot, here is the pushed image/manifest for this PR:

ghcr.io/linuxserver/lspipepr-wireguard:1.0.20210914-r4-pkg-4f3b409f-dev-b83617d36010dd6606e9f31cb928892fa8d78c6f-pr-332

@LinuxServer-CI
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

Copy link

This pull request is locked due to inactivity

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG] missing /32 in interface address
3 participants