1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 01:54:57 +00:00

Kernel: Add getpeername() syscall, and fix getsockname() behavior.

We were copying the raw IPv4 addresses into the wrong part of sockaddr_in,
and we didn't set sa_family or sa_port.
This commit is contained in:
Andreas Kling 2019-05-20 20:33:03 +02:00
parent f008156dbf
commit ae470ec955
11 changed files with 73 additions and 9 deletions

View file

@ -274,6 +274,8 @@ static dword handle(RegisterDump& regs, dword function, dword arg1, dword arg2,
return current->process().sys$writev((int)arg1, (const struct iovec*)arg2, (int)arg3);
case Syscall::SC_getsockname:
return current->process().sys$getsockname((int)arg1, (sockaddr*)arg2, (socklen_t*)arg3);
case Syscall::SC_getpeername:
return current->process().sys$getpeername((int)arg1, (sockaddr*)arg2, (socklen_t*)arg3);
default:
kprintf("<%u> int0x82: Unknown function %u requested {%x, %x, %x}\n", current->process().pid(), function, arg1, arg2, arg3);
break;