commit 7731400be7e374ef812c5eba7440df1f3d0754a0
parent 56e8f99ee04608555c4d288ae6dec60f5611479c
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Tue, 11 Aug 2026 16:12:24 +0200
transport: an incoming request must only look at its own
Diffstat:
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/service/transport/gnunet-service-transport.c b/src/service/transport/gnunet-service-transport.c
@@ -10608,6 +10608,12 @@ handle_hello_for_incoming (void *cls,
GNUNET_PEERSTORE_monitor_next (ir->nc, 1);
return;
}
+ if (0 != GNUNET_memcmp (&record->peer, &ir->pid))
+ {
+ /* Not the peer this request is about. */
+ GNUNET_PEERSTORE_monitor_next (ir->nc, 1);
+ return;
+ }
parser = GNUNET_HELLO_parser_from_msg (hello, &record->peer);
if (NULL != parser)
{
@@ -10675,10 +10681,14 @@ try_to_bring_link_up (const struct GNUNET_PeerIdentity *pid)
ir = GNUNET_new (struct IncomingRequest);
ir->pid = *pid;
GNUNET_CONTAINER_DLL_insert (ir_head, ir_tail, ir);
+ /* Monitor only @a pid: with NULL every request sees every HELLO in
+ PEERSTORE, so each of the up to #MAX_INCOMING_REQUEST requests started
+ a connection attempt and an address validation for peers it was not
+ created for. */
ir->nc = GNUNET_PEERSTORE_monitor_start (GST_cfg,
GNUNET_YES,
"peerstore",
- NULL,
+ &ir->pid,
GNUNET_PEERSTORE_HELLO_KEY,
&hello_for_incoming_error_cb,
NULL,