fix(warp): correct IPv6 address removal sed rule for IPv4-only VPS#5417
Open
EricPrometheus wants to merge 1 commit into
Open
fix(warp): correct IPv6 address removal sed rule for IPv4-only VPS#5417EricPrometheus wants to merge 1 commit into
EricPrometheus wants to merge 1 commit into
Conversation
The old sed rule only matched lines starting with IPv6 patterns, but wgcf generates `Address = IPv4, IPv6` on a single line. This caused the IPv6 address to remain in wgcf-profile.conf on IPv4-only VPS, making wg-quick@warp fail with "RTNETLINK answers: Permission denied". The new rule strips `, <ipv6>/<prefix>` from the Address line, leaving only the IPv4 address.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On IPv4-only VPS (no IPv6 address,
net.ipv6.conf.all.disable_ipv6 = 1),wg-quick@warpfails to start with:The WARP tunnel becomes completely non-functional.
Root Cause
other/warp/wireguard/run.sh.j2line 43 has a sed rule intended to strip IPv6 addresses when the system doesn't support IPv6:However,
wgcf generateproduces Address lines with both IPv4 and IPv6 on the same line:The old sed rule tries to match lines starting with IPv6 hex patterns, but since the line starts with
172.16.0.2, it doesn't match. The IPv6 address remains,wg-quickattemptsip -6 address add, and the kernel rejects it, causing the entire interface to be torn down.Fix
Replace the sed rule to strip
, <ipv6>/<prefix>from the Address line directly:Result:
Testing
curl --interface warp https://cloudflare.com/cdn-cgi/traceconfirmswarp=onFile Changed
other/warp/wireguard/run.sh.j2— 1 line changed