Skip to content

Commit d7b80c5

Browse files
authored
fix: listener refuse client connections for now (#929)
1 parent 6478548 commit d7b80c5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/transport/unicast/transport.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ z_result_t _z_unicast_handshake_listen(_z_transport_unicast_establish_param_t *p
227227
return _Z_ERR_MESSAGE_UNEXPECTED;
228228
}
229229
_Z_DEBUG("Received Z_INIT(Syn)");
230+
// Check if node is in client mode
231+
if (tmsg._body._init._whatami == Z_WHATAMI_CLIENT) {
232+
_z_t_msg_clear(&tmsg);
233+
_Z_INFO("Warning: Peer mode does not support client connection for the moment.");
234+
return _Z_ERR_GENERIC;
235+
}
230236
// Encode InitAck
231237
_z_slice_t cookie = _z_slice_null();
232238
_z_transport_message_t iam = _z_t_msg_make_init_ack(mode, *local_zid, cookie);

0 commit comments

Comments
 (0)