File 2471-epmd-rename-PORT_PLEASE2_REQ.patch of Package erlang
From 74f6b1169c26e875f0ea5dd9f23bf4afb5e28458 Mon Sep 17 00:00:00 2001
From: Fernando Areias <nando.calheirosx@gmail.com>
Date: Tue, 5 Aug 2025 18:17:24 -0300
Subject: [PATCH 1/2] epmd: rename PORT_PLEASE2_REQ
---
erts/doc/guides/erl_dist_protocol.md | 8 ++++----
erts/epmd/test/epmd_SUITE.erl | 8 ++++----
lib/kernel/src/erl_epmd.erl | 2 +-
lib/kernel/src/erl_epmd.hrl | 2 +-
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/erts/doc/guides/erl_dist_protocol.md b/erts/doc/guides/erl_dist_protocol.md
index 1b2bef03aa..30004f6e5f 100644
--- a/erts/doc/guides/erl_dist_protocol.md
+++ b/erts/doc/guides/erl_dist_protocol.md
@@ -90,7 +90,7 @@ sequenceDiagram
client ->> EPMD: ALIVE_CLOSE_REQ
Note over client: Get the Distribution Port of Another Node
- client ->> EPMD: PORT_PLEASE2_REQ
+ client ->> EPMD: EPMD_PORT2_REQ
EPMD -->> client: PORT2_RESP
Note over client: Get All Registered Names from EPMD
@@ -212,7 +212,7 @@ sequenceDiagram
### Get the Distribution Port of Another Node
When one node wants to connect to another node it starts with a
-`PORT_PLEASE2_REQ` request to the EPMD on the host where the node resides to get
+`EPMD_PORT2_REQ` request to the EPMD on the host where the node resides to get
the distribution port that the node listens to:
```mermaid
@@ -223,7 +223,7 @@ sequenceDiagram
participant client as Client (or Node)
participant EPMD
- client ->> EPMD: PORT_PLEASE2_REQ
+ client ->> EPMD: EPMD_PORT2_REQ
EPMD -->> client: PORT2_RESP
```
@@ -232,7 +232,7 @@ sequenceDiagram
| ----- | ---------- |
| `122` | `NodeName` |
-_Table: PORT_PLEASE2_REQ (122)_
+_Table: EPMD_PORT2_REQ (122)_
where N = `Length` \- 1.
diff --git a/erts/epmd/test/epmd_SUITE.erl b/erts/epmd/test/epmd_SUITE.erl
index 99b9b4fd27..9b2ca50944 100644
--- a/erts/epmd/test/epmd_SUITE.erl
+++ b/erts/epmd/test/epmd_SUITE.erl
@@ -96,7 +96,7 @@
% Message codes in epmd protocol
-define(EPMD_ALIVE2_REQ, $x).
-define(EPMD_ALIVE2_RESP, $y).
--define(EPMD_PORT_PLEASE2_REQ, $z).
+-define(EPMD_PORT2_REQ, $z).
-define(EPMD_PORT2_RESP, $w).
-define(EPMD_NAMES_REQ, $n).
-define(EPMD_DUMP_REQ, $d).
@@ -249,7 +249,7 @@ register_node_v2(Addr, Port, NodeType, Prot, HVsn, LVsn, Name, Extra) ->
% Internal function to fetch information about a node
port_please_v2(Name) ->
- case send_req([?EPMD_PORT_PLEASE2_REQ,
+ case send_req([?EPMD_PORT2_REQ,
binary_to_list(unicode:characters_to_binary(Name))]) of
{ok,Sock} ->
case recv_until_sock_closes(Sock) of
@@ -394,11 +394,11 @@ parse_name([], _Name) -> error.
%% Register a name on a port and ask about port nr
get_port_nr(Config) when is_list(Config) ->
- port_request([?EPMD_PORT_PLEASE2_REQ,"foo"]).
+ port_request([?EPMD_PORT2_REQ,"foo"]).
%% Register with slow write and ask about port nr
slow_get_port_nr(Config) when is_list(Config) ->
- port_request([?EPMD_PORT_PLEASE2_REQ,d,$f,d,$o,d,$o]).
+ port_request([?EPMD_PORT2_REQ,d,$f,d,$o,d,$o]).
% Internal function used above
diff --git a/lib/kernel/src/erl_epmd.erl b/lib/kernel/src/erl_epmd.erl
index 4a631d04c2..4ceda4256a 100644
--- a/lib/kernel/src/erl_epmd.erl
+++ b/lib/kernel/src/erl_epmd.erl
@@ -525,7 +525,7 @@ get_port(Node, EpmdAddress, Timeout) ->
{ok, Socket} ->
Name = to_string(Node),
Len = 1+length(Name),
- Msg = [?int16(Len),?EPMD_PORT_PLEASE2_REQ,Name],
+ Msg = [?int16(Len),?EPMD_PORT2_REQ,Name],
case gen_tcp:send(Socket, Msg) of
ok ->
wait_for_port_reply(Socket, []);
diff --git a/lib/kernel/src/erl_epmd.hrl b/lib/kernel/src/erl_epmd.hrl
index af565435a1..deb9c4385d 100644
--- a/lib/kernel/src/erl_epmd.hrl
+++ b/lib/kernel/src/erl_epmd.hrl
@@ -21,7 +21,7 @@
%%
-define(EPMD_ALIVE2_REQ, $x).
--define(EPMD_PORT_PLEASE2_REQ, $z).
+-define(EPMD_PORT2_REQ, $z).
-define(EPMD_ALIVE2_RESP, $y).
-define(EPMD_PORT2_RESP, $w).
-define(EPMD_NAMES, $n).
--
2.43.0