mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:18:12 +00:00
Kernel/IPv4: Propagate errors from local port allocation
Remove hacks and assumptions and make the EADDRINUSE propagate all the way from the point of failure to the syscall layer.
This commit is contained in:
parent
8f8fbf3487
commit
71a10eb8e7
6 changed files with 21 additions and 21 deletions
|
@ -97,7 +97,7 @@ KResult UDPSocket::protocol_connect(FileDescription&, ShouldBlock)
|
|||
return KSuccess;
|
||||
}
|
||||
|
||||
int UDPSocket::protocol_allocate_local_port()
|
||||
KResultOr<u16> UDPSocket::protocol_allocate_local_port()
|
||||
{
|
||||
static const u16 first_ephemeral_port = 32768;
|
||||
static const u16 last_ephemeral_port = 60999;
|
||||
|
@ -118,7 +118,7 @@ int UDPSocket::protocol_allocate_local_port()
|
|||
if (port == first_scan_port)
|
||||
break;
|
||||
}
|
||||
return -EADDRINUSE;
|
||||
return EADDRINUSE;
|
||||
}
|
||||
|
||||
KResult UDPSocket::protocol_bind()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue