mirror of
https://github.com/ksherlock/marignotti.git
synced 2024-12-21 08:29:31 +00:00
handle binding port 0.
This commit is contained in:
parent
7c7a339b39
commit
46270ba354
15
mbind.c
15
mbind.c
@ -56,10 +56,19 @@ int mbind(Entry *e, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
|
||||
// address component is ignored -- only port is used.
|
||||
|
||||
IncBusy();
|
||||
TCPIPSetSourcePort(e->ipid, port);
|
||||
DecBusy();
|
||||
// bind w/ port 0 means the system should pick a port.
|
||||
// marinetti picks a port at TCPIPLogin time, so no need
|
||||
// to do anything here.
|
||||
|
||||
// Note: TCPIPSetSourcePort does not check if the port is free.
|
||||
|
||||
// todo -- return EACCES if reserved port && !root.
|
||||
if (port)
|
||||
{
|
||||
IncBusy();
|
||||
TCPIPSetSourcePort(e->ipid, port);
|
||||
DecBusy();
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user