From 9a2799e24cecbaaa630df001eae097ac96af863c Mon Sep 17 00:00:00 2001 From: achingbrain Date: Tue, 19 Jul 2022 12:11:47 +0100 Subject: [PATCH] Clarify use of E_DIAL_REFUSED in autonat Adds a paragraph detailing when `E_DIAL_REFUSED` should be sent as a `DialResponse` status as it's not mentioned in the current spec. I think this is consistent with go-libp2p since https://github.com/libp2p/go-libp2p/pull/1527 --- autonat/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/autonat/README.md b/autonat/README.md index eabb435d5..2c4c15ab7 100644 --- a/autonat/README.md +++ b/autonat/README.md @@ -78,6 +78,12 @@ If all dials fail, the receiver sends a `DialResponse` message with the successfully, it sends a `DialResponse` with the `ResponseStatus` `OK`. It SHOULD include the address it successfully dialed in its response. +If the receiver elects not to dial any addresses from the message - for example +because they are invalid, because they resolve to the same host as the receiver, +because they only include private addresses, because it does not support the +relevant transports, or because it has no capacity, is sends a `DialResponse` +message with the `ResponseStatus` `E_DIAL_REFUSED`. + The initiator uses the responses obtained from multiple peers to determine its NAT status. If more than 3 peers report a successfully dialed address, the node SHOULD assume that it is not located behind a NAT and publicly accessible. On