Merge pull request 'fix(native): 延迟云端中继 ACK 以完成京东原生握手' (#2) from codex/jd-native-outbound-relay-20260806 into main
This commit is contained in:
commit
4cbf7a2c19
3 changed files with 11 additions and 0 deletions
|
|
@ -123,6 +123,7 @@ def main() -> None:
|
||||||
parser.add_argument("--resident-pipeline", action="store_true")
|
parser.add_argument("--resident-pipeline", action="store_true")
|
||||||
parser.add_argument("--native-relay", action="store_true")
|
parser.add_argument("--native-relay", action="store_true")
|
||||||
parser.add_argument("--allowed-source")
|
parser.add_argument("--allowed-source")
|
||||||
|
parser.add_argument("--native-ack-delay", type=float, default=0.25)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if args.retry_interval < 1.0:
|
if args.retry_interval < 1.0:
|
||||||
raise SystemExit("--retry-interval must be at least 1 second")
|
raise SystemExit("--retry-interval must be at least 1 second")
|
||||||
|
|
@ -130,6 +131,8 @@ def main() -> None:
|
||||||
0 <= args.resume_resident_count <= 10
|
0 <= args.resume_resident_count <= 10
|
||||||
):
|
):
|
||||||
raise SystemExit("--resume-resident-count must be between 0 and 10")
|
raise SystemExit("--resume-resident-count must be between 0 and 10")
|
||||||
|
if not 0.0 <= args.native_ack_delay <= 2.0:
|
||||||
|
raise SystemExit("--native-ack-delay must be between 0 and 2 seconds")
|
||||||
if sum(
|
if sum(
|
||||||
(
|
(
|
||||||
args.resident,
|
args.resident,
|
||||||
|
|
@ -181,6 +184,10 @@ def main() -> None:
|
||||||
continue
|
continue
|
||||||
if source != allowed_source:
|
if source != allowed_source:
|
||||||
continue
|
continue
|
||||||
|
# The public-cloud NAT path is established by the host kernel's
|
||||||
|
# ordinary echo reply. Delay the authenticated ACK long enough for
|
||||||
|
# the native guest to discard that reply and repost its RX buffer.
|
||||||
|
time.sleep(args.native_ack_delay)
|
||||||
peer.sendto(native_ack_reply(packet), address)
|
peer.sendto(native_ack_reply(packet), address)
|
||||||
acknowledged.add(sequence)
|
acknowledged.add(sequence)
|
||||||
sources.add(source)
|
sources.add(source)
|
||||||
|
|
@ -197,6 +204,7 @@ def main() -> None:
|
||||||
"status: PASS_100\n"
|
"status: PASS_100\n"
|
||||||
"handshake_direction: NATIVE_INITIATED_OUTBOUND_ICMP\n"
|
"handshake_direction: NATIVE_INITIATED_OUTBOUND_ICMP\n"
|
||||||
"native_ack_marker: HLDP-NATIVE-ACK!\n"
|
"native_ack_marker: HLDP-NATIVE-ACK!\n"
|
||||||
|
f"native_ack_delay_seconds: {args.native_ack_delay:g}\n"
|
||||||
"acknowledged_sequences: 1-16\n"
|
"acknowledged_sequences: 1-16\n"
|
||||||
f"observed_nat_sources: {','.join(sorted(sources))}\n"
|
f"observed_nat_sources: {','.join(sorted(sources))}\n"
|
||||||
"login_reply_count: 3\n"
|
"login_reply_count: 3\n"
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ native_network:
|
||||||
gateway_ipv4: 172.16.0.1
|
gateway_ipv4: 172.16.0.1
|
||||||
relay_ipv4: 43.153.193.169
|
relay_ipv4: 43.153.193.169
|
||||||
handshake_direction: NATIVE_INITIATED_OUTBOUND_ICMP
|
handshake_direction: NATIVE_INITIATED_OUTBOUND_ICMP
|
||||||
|
native_ack_delay_seconds: 0.25
|
||||||
public_nat_address_recorded_in_world: false
|
public_nat_address_recorded_in_world: false
|
||||||
gestational_continuity:
|
gestational_continuity:
|
||||||
id: GLS-0845
|
id: GLS-0845
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ handshake:
|
||||||
direction: NATIVE_INITIATED_OUTBOUND_ICMP
|
direction: NATIVE_INITIATED_OUTBOUND_ICMP
|
||||||
request_magic_source: CURRENT_HLDP_COMMAND
|
request_magic_source: CURRENT_HLDP_COMMAND
|
||||||
response_marker: HLDP-NATIVE-ACK!
|
response_marker: HLDP-NATIVE-ACK!
|
||||||
|
response_delay_seconds: 0.25
|
||||||
|
response_delay_reason: ALLOW_KERNEL_NAT_REPLY_THEN_NATIVE_RX_REPOST
|
||||||
expected_sequences: 1-16
|
expected_sequences: 1-16
|
||||||
ordinary_echo_action: IGNORE
|
ordinary_echo_action: IGNORE
|
||||||
stale_sequence_action: IGNORE_WITHOUT_STATE_ADVANCE
|
stale_sequence_action: IGNORE_WITHOUT_STATE_ADVANCE
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue