<p></p>
<p><b>@benpicco</b> commented on this pull request.</p>

<p>This looks good at a cursory glance</p><hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16459#discussion_r662350737">sys/net/gnrc/transport_layer/tcp/gnrc_tcp.c</a>:</p>
<pre style='color:#555'>> +                }
+            }
+#endif
+            tcb->local_port = local->port;
+            tcb->status |= STATUS_LISTENING;
+
+            /* Open connection */
+            ret = _gnrc_tcp_fsm(tcb, FSM_EVENT_CALL_OPEN, NULL, NULL, 0);
+        }
+
+        /* If anything goes wrong, discard all potentially opened connections. */
+        if (ret) {
+            for (size_t j = 0; j <= i; ++j) {
+                tcb->status &= ~(STATUS_LISTENING);
+                _abort(tcb);
+            }
</pre>
<p>should we <code>break</code> here?</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16459#discussion_r662354619">sys/net/gnrc/transport_layer/tcp/gnrc_tcp.c</a>:</p>
<pre style='color:#555'>> +        if (!(tmp->status & STATUS_ACCEPTED)) {
+
</pre>

⬇️ Suggested change
<pre style="color: #555">-        if (!(tmp->status & STATUS_ACCEPTED)) {
-
+        if (tmp->status & STATUS_ACCEPTED) {
+            continue;
+        }
</pre>

<p>nesting</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16459#discussion_r662494054">sys/net/gnrc/transport_layer/tcp/gnrc_tcp_fsm.c</a>:</p>
<pre style='color:#555'>> @@ -196,8 +211,19 @@ static int _transition_to(gnrc_tcp_tcb_t *tcb, _gnrc_tcp_fsm_state_t state)
             break;
 
         case FSM_STATE_SYN_RCVD:
+            /* Setup timeout for listening TCBs */
+            if (tcb->status & STATUS_LISTENING) {
+                _gnrc_tcp_eventloop_sched(&tcb->event_timeout, CONFIG_GNRC_TCP_CONNECTION_TIMEOUT_DURATION_MS,
</pre>

⬇️ Suggested change
<pre style="color: #555">-                _gnrc_tcp_eventloop_sched(&tcb->event_timeout, CONFIG_GNRC_TCP_CONNECTION_TIMEOUT_DURATION_MS,
+                _gnrc_tcp_eventloop_sched(&tcb->event_timeout,
+                                          CONFIG_GNRC_TCP_CONNECTION_TIMEOUT_DURATION_MS,
</pre>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/16459#pullrequestreview-697329851">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYETREEGYWO5ECQU5CLTVSVELANCNFSM44MMMB5A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYAHNXNIOTDVYZDDCCLTVSVELA5CNFSM44MMMB5KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOFGIGROY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/16459#pullrequestreview-697329851",
"url": "https://github.com/RIOT-OS/RIOT/pull/16459#pullrequestreview-697329851",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>