NetBSD Problem Report #37644

From spz@volans.1st.de  Sat Dec 29 16:44:22 2007
Return-Path: <spz@volans.1st.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id A873063B8F0
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 29 Dec 2007 16:44:22 +0000 (UTC)
Message-Id: <20071229164352.4625EF1F59@volans.1st.de>
Date: Sat, 29 Dec 2007 17:43:52 +0100 (CET)
From: spz@volans.1st.de
Reply-To: spz@volans.1st.de
To: gnats-bugs@NetBSD.org
Subject: racoon fails to bring IPv6 connections into phase 2
X-Send-Pr-Version: 3.95

>Number:         37644
>Category:       bin
>Synopsis:       racoon fails to bring IPv6 connections into phase 2
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 29 16:45:17 +0000 2007
>Closed-Date:    Sun Feb 10 12:14:38 +0000 2008
>Last-Modified:  Sun Feb 10 12:14:38 +0000 2008
>Originator:     S.P.Zeidler
>Release:        NetBSD 4.99.45
>Organization:
	dis-
>Environment:
System: NetBSD volans 4.99.45 NetBSD 4.99.45 (VOLANS) #2: Sat Dec 29 09:36:45 CET 2007 spz@volans:/home/netbsd/src/sys/arch/i386/compile/obj/VOLANS i386
Architecture: i386
Machine: i386
>Description:
	racoon fails to bring IPv6 connections into phase 2:
Dec 29 17:03:12 volans racoon: INFO: ISAKMP-SA established 
2001:yyyy:yyyy:yyyy:202:2dff:fe87:b210[500]-2001:yyyy:yyyy:yyyy::1[500] 
spi:zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz 
Dec 29 17:03:13 volans racoon: INFO: initiate new phase 2 negotiation: 
2001:yyyy:yyyy:yyyy:202:2dff:fe87:b210[500]<=>2001:yyyy:yyyy:yyyy::1[500] 
Dec 29 16:14:00 volans racoon: ERROR: mismatched IDci was returned.
Dec 29 16:14:00 volans racoon: ERROR: failed to pre-process packet.
Dec 29 16:14:00 volans racoon: ERROR: phase2 negotiation failed.

(yyyy and zzzz have been used as replacement to protect the guilty :-)

It seems the if in isakmp_quick.c lines 585 and 586:
    if (cmpsaddrstrict((struct sockaddr *) &proposed_addr,
                       (struct sockaddr *) &got_addr) == 0) {
is always false for IPv6. This is due to scope not getting set and then
mismatching with some random garbage.

>How-To-Repeat:
	build racoon, try to get a v6 session going
>Fix:
? ipsec_doi.c.diff
Index: ipsec_doi.c
===================================================================
RCS file: /cvsroot/src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c,v
retrieving revision 1.32
diff -u -r1.32 ipsec_doi.c
--- ipsec_doi.c	4 Dec 2007 19:52:30 -0000	1.32
+++ ipsec_doi.c	24 Jan 2008 08:28:46 -0000
@@ -4313,6 +4313,11 @@
 				: id_b->port);		/* see sockaddr2id() */
 		memcpy(&((struct sockaddr_in6 *)saddr)->sin6_addr,
 			buf->v + sizeof(*id_b), sizeof(struct in6_addr));
+		((struct sockaddr_in6 *)saddr)->sin6_scope_id =
+			(IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *)saddr)->sin6_addr)
+				? ((struct sockaddr_in6 *)id_b)->sin6_scope_id
+				: 0);
+
 		break;
 #endif
 	default:


>Release-Note:

>Audit-Trail:

From: "S.P.Zeidler" <spz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/37644 CVS commit: src/crypto/dist/ipsec-tools/src/racoon
Date: Sun, 10 Feb 2008 12:11:08 +0000 (UTC)

 Module Name:	src
 Committed By:	spz
 Date:		Sun Feb 10 12:11:08 UTC 2008

 Modified Files:
 	src/crypto/dist/ipsec-tools/src/racoon: ipsec_doi.c

 Log Message:
 closes PR bin/37644
 did not meet violent opposition ( :) ) on ipsec-tools-devel


 To generate a diff of this commit:
 cvs rdiff -r1.32 -r1.33 src/crypto/dist/ipsec-tools/src/racoon/ipsec_doi.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: spz@narn.netbsd.org
State-Changed-When: Sun, 10 Feb 2008 12:14:38 +0000
State-Changed-Why:
fix committed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.