From jinmei@shuttle.wide.toshiba.co.jp  Fri Jul 25 15:50:02 2003
Return-Path: <jinmei@shuttle.wide.toshiba.co.jp>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 967EA37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Jul 2003 15:50:02 -0700 (PDT)
Received: from shuttle.wide.toshiba.co.jp (shuttle.wide.toshiba.co.jp [202.249.10.124])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0634743F3F
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Jul 2003 15:50:02 -0700 (PDT)
	(envelope-from jinmei@shuttle.wide.toshiba.co.jp)
Received: from shuttle.wide.toshiba.co.jp (localhost [::1])
	by shuttle.wide.toshiba.co.jp (Postfix) with ESMTP id 463E41525D
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Jul 2003 07:50:00 +0900 (JST)
Received: (from jinmei@localhost)
	by shuttle.wide.toshiba.co.jp (8.12.8p1/8.12.6/Submit) id h6PMnxOQ093139;
	Sat, 26 Jul 2003 07:49:59 +0900 (JST)
Message-Id: <200307252249.h6PMnxOQ093139@shuttle.wide.toshiba.co.jp>
Date: Sat, 26 Jul 2003 07:49:59 +0900 (JST)
From: Jinmei Tatuya <jinmei@shuttle.wide.toshiba.co.jp>
Reply-To: Jinmei Tatuya <jinmei@shuttle.wide.toshiba.co.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ip6fw does not handle ESP correctly
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         54874
>Category:       kern
>Synopsis:       ip6fw does not handle ESP correctly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ume
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 25 15:50:14 PDT 2003
>Closed-Date:    Mon Aug 04 11:49:50 PDT 2003
>Last-Modified:  Mon Aug 04 11:49:50 PDT 2003
>Originator:     JINMEI Tatuya
>Release:        FreeBSD 4.8-RELEASE i386
>Organization:
Toshiba Corporation
>Environment:
System: FreeBSD ocean.jinmei.org 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Thu Jun 26 13:24:02 JST 2003 jinmei@jinmei.jinmei.org:/home/jinmei/src/kame/kame/freebsd4/sys/compile/SS2010_SCTP i386


>Description:

ip6fw does not recognize ESP packets correctly when the packets are specified
as protocol 50 (or "ESP") by the ip6fw command.  For example, even if the
following line is installed:

add	pass	esp	from any to any

The kernel does not apply this rule to IPv6 ESP packets.  Instead, we need
to specify like this:

add pass all from any to any ipv6options esp

I don't think this is intentional.

>How-To-Repeat:

See above.
	
>Fix:

I believe the following patch should be applied.  Apparently the current code
will also need the same fix.

Index: ip6_fw.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/ip6_fw.c,v
retrieving revision 1.2.2.9
diff -u -r1.2.2.9 ip6_fw.c
--- ip6_fw.c	28 Apr 2002 05:40:27 -0000	1.2.2.9
+++ ip6_fw.c	25 Jul 2003 22:49:39 -0000
@@ -288,6 +288,7 @@
 			case IPPROTO_ESP:
 				opts &= ~IPV6_FW_IP6OPT_ESP;
 				nopts &= ~IPV6_FW_IP6OPT_ESP;
+				goto opts_check;
 				break;
 			case IPPROTO_NONE:
 				opts &= ~IPV6_FW_IP6OPT_NONXT;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: ume 
State-Changed-When: Sun Jul 27 09:21:44 PDT 2003 
State-Changed-Why:  
Because I committed it. 


Responsible-Changed-From-To: freebsd-bugs->ume 
Responsible-Changed-By: ume 
Responsible-Changed-When: Sun Jul 27 09:21:44 PDT 2003 
Responsible-Changed-Why:  
Thanks!  I've just committed it into 5-CURRENT. 
I'll do MFC after 1 week. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54874 
State-Changed-From-To: analyzed->closed 
State-Changed-By: ume 
State-Changed-When: Mon Aug 4 11:48:32 PDT 2003 
State-Changed-Why:  
It was MFC'ed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54874 
>Unformatted:
