MINOR: sock: distinguish dgram from stream types when retrieving old sockets

For now we still don't retrieve dgram sockets, but the code must be able
to distinguish them before we switch to receivers. This adds a new flag
to the xfer_sock_list indicating that a socket is of type SOCK_DGRAM. The
way to set the flag for now is by looking at the dummy address family which
equals AF_CUST_UDP{4,6} in this case (given that other dgram sockets are not
yet supported).
diff --git a/src/sock.c b/src/sock.c
index 894f485..1614d95 100644
--- a/src/sock.c
+++ b/src/sock.c
@@ -296,6 +296,10 @@
 		if (sock_inet_is_foreign(fd, xfer_sock->addr.ss_family))
 			xfer_sock->options |= SOCK_XFER_OPT_FOREIGN;
 
+		socklen = sizeof(val);
+		if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &val, &socklen) == 0 && val == SOCK_DGRAM)
+			xfer_sock->options |= SOCK_XFER_OPT_DGRAM;
+
 #if defined(IPV6_V6ONLY)
 		/* keep only the v6only flag depending on what's currently
 		 * active on the socket, and always drop the v4v6 one.
@@ -362,6 +366,12 @@
 	if (!l->proto->addrcmp)
 		return -1;
 
+	/* WT: this is not the right way to do it, it is temporary for the
+	 *     transition to receivers.
+	 */
+	if (l->addr.ss_family == AF_CUST_UDP4 || l->addr.ss_family == AF_CUST_UDP6)
+		options |= SOCK_XFER_OPT_DGRAM;
+
 	if (l->options & LI_O_FOREIGN)
 		options |= SOCK_XFER_OPT_FOREIGN;