Subject: Re: [PATCHv2] tcp: Fix MD5 signature checking on IPv4 mapped sockets

From: Stephen Hemminger <[email-masked]>
Date: Thu, 16 Jul 2009 11:36:52 -0700

On Thu, 16 Jul 2009 10:04:51 -0500
John Dykstra <[email-masked]> wrote:

> This revision to the patch removes a misplaced
> blank line.
> 
> ---
> Fix MD5 signature checking so that an IPv4 active open
> to an IPv6 socket can succeed.  In particular, use the
> correct address family's signature generation function
> for the SYN/ACK.
> 
> Reported-by:   Stephen Hemminger <[email-masked]>
> Signed-off-by: John Dykstra <[email-masked]>

This fixes the syn-ack, but data does not flow.
I had a simpler attempt that had same problem:

--- a/net/ipv6/tcp_ipv6.c	2009-07-15 18:08:11.042505387 -0700
+++ b/net/ipv6/tcp_ipv6.c	2009-07-15 20:05:56.270009553 -0700
@@ -1169,8 +1169,17 @@ static int tcp_v6_conn_request(struct so
 #define want_cookie 0
 #endif
 
-	if (skb->protocol == htons(ETH_P_IP))
-		return tcp_v4_conn_request(sk, skb);
+	if (skb->protocol == htons(ETH_P_IP)) {
+		int err;
+#ifdef CONFIG_TCP_MD5SIG
+		tp->af_specific = &tcp_sock_ipv6_mapped_specific;
+#endif
+		err = tcp_v4_conn_request(sk, skb);
+#ifdef CONFIG_TCP_MD5SIG
+		tp->af_specific = &tcp_sock_ipv6_specific;
+#endif
+		return err;
+	}
 
 	if (!ipv6_unicast_destination(skb))
 		goto drop;