net: decode setsockopt() multicast arguments

* configure.ac (AC_CHECK_FUNCS): Add inet_pton.
* net.c (print_mreq, print_mreq6): New functions.
(print_setsockopt): Use them to decode IP_ADD_MEMBERSHIP,
IP_DROP_MEMBERSHIP, IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP,
IPV6_JOIN_ANYCAST, and IPV6_LEAVE_ANYCAST.
* tests/ip_mreq.c: New file.
* tests/ip_mreq.expected: Likewise.
* tests/ip_mreq.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add ip_mreq.
(TESTS): Add ip_mreq.test.
(EXTRA_DIST): ip_mreq.expected.
* tests/.gitignore: Add ip_mreq.

Based on patch by Ben Noordhuis <info@bnoordhuis.nl>.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7ace705..f1e8820 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,6 +14,7 @@
 	getrandom \
 	inet-accept-connect-send-recv \
 	ioctl \
+	ip_mreq \
 	ipc_msg \
 	ipc_sem \
 	ipc_shm \
@@ -61,6 +62,7 @@
 	getdents.test \
 	getrandom.test \
 	ioctl.test \
+	ip_mreq.test \
 	ipc_msg.test \
 	ipc_shm.test \
 	ipc_sem.test \
@@ -109,6 +111,7 @@
 	     getdents.out \
 	     getrandom.awk \
 	     ioctl.expected \
+	     ip_mreq.expected \
 	     ipc.sh \
 	     mmsg.expected \
 	     net.expected \