net.c: recvfrom fixes
This change fixes these three problems (before/after is shown):
On interrupted syscall, flags are not decoded:
-recvfrom(3, 0x7fff0a41e306, 10, 2, 0, 0) = ? ERESTARTSYS
+recvfrom(3, 0x7fff0a41e306, 10, MSG_PEEK, 0, 0) = ? ERESTARTSYS
If peer address is unavalable (example: anon sockets from socketpair()),
kernel returns socklen of 0, but we ignore that and show bogus sockaddr data:
-recvfrom(3, "123456789\0", 10, MSG_PEEK, {sa_family=0x7777 /* AF_??? */, sa_data="wwwwwwwwwwwwww"}, [0]) = 10
+recvfrom(3, "123456789\0", 10, MSG_PEEK, 0x7ffde6edf760, [0]) = 10
SYS_FUNC(recvfrom) passes address of fromlen, not fromlen, to printsock():
- printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]);
+ printsock(tcp, tcp->u_arg[4], fromlen);
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
1 file changed