Skip to content

Commit 82c8201

Browse files
hlefnwf
authored andcommitted
tcpip: remove redundant call to with_restarting_checks.
Not sure why we added that call, as `with_restarting_checks` is called in `with_sealed_socket`. This frees up 128B. Signed-off-by: Hugo Lefeuvre <[email protected]>
1 parent 92b0f68 commit 82c8201

File tree

1 file changed

+20
-25
lines changed

1 file changed

+20
-25
lines changed

lib/tcpip/network_wrapper.cc

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,30 +1287,25 @@ ssize_t network_socket_send_to(Timeout *timeout,
12871287

12881288
int network_socket_kind(Socket socket, SocketKind *kind)
12891289
{
1290-
return with_restarting_checks(
1291-
[&]() -> int {
1292-
kind->protocol = SocketKind::Invalid;
1293-
kind->localPort = 0;
1294-
int ret = with_sealed_socket(
1295-
[&](SealedSocket *socket) {
1296-
if (socket->socket->ucProtocol == FREERTOS_IPPROTO_TCP)
1297-
{
1298-
kind->protocol = socket->socket->bits.bIsIPv6
1299-
? SocketKind::TCPIPv6
1300-
: SocketKind::TCPIPv4;
1301-
}
1302-
else
1303-
{
1304-
kind->protocol = socket->socket->bits.bIsIPv6
1305-
? SocketKind::UDPIPv6
1306-
: SocketKind::UDPIPv4;
1307-
}
1308-
kind->localPort = listGET_LIST_ITEM_VALUE(
1309-
(&((socket->socket)->xBoundSocketListItem)));
1310-
return 0;
1311-
},
1312-
socket);
1313-
return ret;
1290+
kind->protocol = SocketKind::Invalid;
1291+
kind->localPort = 0;
1292+
return with_sealed_socket(
1293+
[&](SealedSocket *socket) {
1294+
if (socket->socket->ucProtocol == FREERTOS_IPPROTO_TCP)
1295+
{
1296+
kind->protocol = socket->socket->bits.bIsIPv6
1297+
? SocketKind::TCPIPv6
1298+
: SocketKind::TCPIPv4;
1299+
}
1300+
else
1301+
{
1302+
kind->protocol = socket->socket->bits.bIsIPv6
1303+
? SocketKind::UDPIPv6
1304+
: SocketKind::UDPIPv4;
1305+
}
1306+
kind->localPort = listGET_LIST_ITEM_VALUE(
1307+
(&((socket->socket)->xBoundSocketListItem)));
1308+
return 0;
13141309
},
1315-
-1 /* invalid if we are restarting */);
1310+
socket);
13161311
}

0 commit comments

Comments
 (0)