Fix dumping of recvmsg syscall in case of short read

* defs.h (dumpiov_in_msghdr): Add unsigned long argument.
* net.c (dumpiov_in_msghdr): Add data_size argument.  Call dumpiov_upto
instead of dumpiov, pass data_size to dumpiov_upto.
* syscall.c (dumpio): Pass data size limit to dumpiov_in_msghdr.
* NEWS: Mention this fix.
* tests/recvmsg.c: New file.
* tests/recvmsg.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add recvmsg.
(TESTS): Add recvmsg.test.
* tests/.gitignore: Add recvmsg.
diff --git a/syscall.c b/syscall.c
index 5f7b0ed..9729fe5 100644
--- a/syscall.c
+++ b/syscall.c
@@ -691,7 +691,7 @@
 				     tcp->u_rval);
 			return;
 		case SEN_recvmsg:
-			dumpiov_in_msghdr(tcp, tcp->u_arg[1]);
+			dumpiov_in_msghdr(tcp, tcp->u_arg[1], tcp->u_rval);
 			return;
 		case SEN_recvmmsg:
 			dumpiov_in_mmsghdr(tcp, tcp->u_arg[1]);
@@ -710,7 +710,8 @@
 			dumpiov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
 			break;
 		case SEN_sendmsg:
-			dumpiov_in_msghdr(tcp, tcp->u_arg[1]);
+			dumpiov_in_msghdr(tcp, tcp->u_arg[1],
+					  (unsigned long) -1L);
 			break;
 		case SEN_sendmmsg:
 			dumpiov_in_mmsghdr(tcp, tcp->u_arg[1]);