MINOR: sample: Add ipv6 to ipv4 and sint to ipv6 casts

The RFC4291 says that when the IPv6 adress have the followin form:
0000::ffff:a.b.c.d, if can be converted to an IPv4 adress. This patch
enable this conversion in casts.

As the sint can be casted as ipv4, and ipv4 can be casted as ipv6, we
can directly cast sint as ipv6 using the RFC4291.
diff --git a/src/sample.c b/src/sample.c
index eb00536..6bb2dfd 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -526,6 +526,14 @@
 	return 1;
 }
 
+static int c_ipv62ip(struct sample *smp)
+{
+	if (!v6tov4(&smp->data.ipv4, &smp->data.ipv6))
+		return 0;
+	smp->type = SMP_T_IPV6;
+	return 1;
+}
+
 static int c_ipv62str(struct sample *smp)
 {
 	struct chunk *trash = get_trash_chunk();
@@ -554,6 +562,14 @@
 	return 1;
 }
 
+static int c_int2ipv6(struct sample *smp)
+{
+	smp->data.ipv4.s_addr = htonl((unsigned int)smp->data.sint);
+	v4tov6(&smp->data.ipv6, &smp->data.ipv4);
+	smp->type = SMP_T_IPV6;
+	return 1;
+}
+
 static int c_str2addr(struct sample *smp)
 {
 	if (!buf2ip(smp->data.str.str, smp->data.str.len, &smp->data.ipv4)) {
@@ -768,10 +784,10 @@
 /*            to:  ANY     BOOL       SINT       ADDR        IPV4      IPV6        STR         BIN         METH */
 /* from:  ANY */ { c_none, c_none,    c_none,    c_none,     c_none,   c_none,     c_none,     c_none,     c_none,     },
 /*       BOOL */ { c_none, c_none,    c_none,    NULL,       NULL,     NULL,       c_int2str,  NULL,       NULL,       },
-/*       SINT */ { c_none, c_none,    c_none,    c_int2ip,   c_int2ip, NULL,       c_int2str,  c_int2bin,  NULL,       },
+/*       SINT */ { c_none, c_none,    c_none,    c_int2ip,   c_int2ip, c_int2ipv6, c_int2str,  c_int2bin,  NULL,       },
 /*       ADDR */ { c_none, NULL,      NULL,      NULL,       NULL,     NULL,       NULL,       NULL,       NULL,       },
 /*       IPV4 */ { c_none, NULL,      c_ip2int,  c_none,     c_none,   c_ip2ipv6,  c_ip2str,   c_addr2bin, NULL,       },
-/*       IPV6 */ { c_none, NULL,      NULL,      c_none,     NULL,     c_none,     c_ipv62str, c_addr2bin, NULL,       },
+/*       IPV6 */ { c_none, NULL,      NULL,      c_none,     c_ipv62ip,c_none,     c_ipv62str, c_addr2bin, NULL,       },
 /*        STR */ { c_none, c_str2int, c_str2int, c_str2addr, c_str2ip, c_str2ipv6, c_none,     c_none,     c_str2meth, },
 /*        BIN */ { c_none, NULL,      NULL,      NULL,       NULL,     NULL,       c_bin2str,  c_none,     c_str2meth, },
 /*       METH */ { c_none, NULL,      NULL,      NULL,       NULL,     NULL,       c_meth2str, c_meth2str, c_none,     }