3x-ui/internal
BlindMaster24 2d8d304850
fix(amneziawg): stop a disabled inbound's relay slot from being taken (#6540)
* test(amneziawg): pin that a disabled row still owns its relay slot

checkAmneziawgnetSocksConflict filters enable = true, so a disabled AmneziaWG
row is not a candidate when an ordinary inbound's configured port is validated.
SetInboundEnable then flips the column with no port check, so enabling that row
later puts a second inbound on 127.0.0.1:65101 and Xray refuses the whole config.
Expected red on this head; the fix follows.

* fix(amneziawg): count a disabled inbound as owning its relay slot

The forward port check filtered its candidates with enable = true, so a disabled
AmneziaWG row was invisible when an ordinary inbound's configured port was
validated. Nothing else covered the gap: the relay is not a database row, and
SetInboundEnable flips the column with no port check, so re-enabling that row put
a second inbound on 127.0.0.1:65101 and made Xray refuse its whole config,
taking every other protocol on the host down with it.

A row owns the slot its id derives for as long as the row exists, which is the
rule the reverse-direction check already follows. TestCheckPortConflict_
DisabledAmneziawgStillOwnsItsRelaySlot fails without this, on a test-only head
whose go-test run failed on exactly that test, and passes with it.

* test(amneziawg): drop the disabled-row case that asserts the reversed rule

TestCheckPortConflict_AmneziawgnetSocksRelayIgnoredWhenDisabled stated, in its
name and its doc comment, that a disabled AmneziaWG inbound's port must not
block anything -- the rule the parent commit reverses. It also never reached the
predicate it named: its fixture seeds Settings: {}, which
amneziawg.InstanceFromInbound rejects on parsed.Server == nil one statement
before the enable column is read, so it passed with or without the filter.

Leaving it would document both rules for the same operator state with nothing
failing to flag the contradiction. The rule this PR pins is covered for real by
TestCheckPortConflict_DisabledAmneziawgStillOwnsItsRelaySlot, whose fixture
carries a qualifying server block and an enabled peer.
2026-09-15 11:33:02 +03:00
..
amneziawg fix(amneziawg): read the outbound pseudo-protocol id like the core (#6531) 2026-09-15 08:23:18 +03:00
amneziawgnet fix(amneziawg): wrap the relay port window instead of refusing ids past it (#6539) 2026-09-15 10:07:14 +03:00
config v3.8.0 2026-09-14 19:11:03 +02:00
crypto/nodetoken fix(nodetoken): make the corrupt-ciphertext test corrupt deterministically (#6520) 2026-09-14 12:08:11 +02:00
database fix(xray): read an outbound protocol id the way the core does (#6521) 2026-09-14 19:52:27 +03:00
eventbus chore: refresh dependencies, fix Linux tool tasks, modernize Go idioms 2026-07-25 16:08:09 +02:00
logger
mtproto fix(mtproto): synchronize child-process lifecycle (#6141) 2026-07-29 20:56:26 +02:00
pia chore(build): bump Go toolchain to 1.27.0 2026-08-23 21:57:03 +02:00
sub feat(sub): add opt-in month-end expiry presentation (#6517) 2026-09-14 12:10:25 +02:00
tuic fix(tuic): evict the oldest relay flow instead of refusing new clients 2026-09-12 10:40:41 +02:00
tunnelmonitor
util fix(link): restore mKCP seed and headerType on share-link import (#6480) 2026-09-13 22:28:13 +02:00
web fix(amneziawg): stop a disabled inbound's relay slot from being taken (#6540) 2026-09-15 11:33:02 +03:00
xray feat(sub): let the panel set the JSON subscription DNS servers (#6485) 2026-09-13 11:51:56 +02:00