From owner-freebsd-net@FreeBSD.ORG Mon Nov 17 21:01:42 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86731106564A; Mon, 17 Nov 2008 21:01:42 +0000 (UTC) (envelope-from sclark46@earthlink.net) Received: from elasmtp-mealy.atl.sa.earthlink.net (elasmtp-mealy.atl.sa.earthlink.net [209.86.89.69]) by mx1.freebsd.org (Postfix) with ESMTP id 36D808FC16; Mon, 17 Nov 2008 21:01:42 +0000 (UTC) (envelope-from sclark46@earthlink.net) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=FNJ5vk4XIVeNYvYpQUUPqV46qfDtBhnzzipdntxDLwsrxiwWsWPpZ4xf4iYXgfNw; h=Received:Message-ID:Date:From:Reply-To:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-ELNK-Trace:X-Originating-IP; Received: from [208.118.36.229] (helo=joker.seclark.com) by elasmtp-mealy.atl.sa.earthlink.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1L2BE5-0007Kp-GD; Mon, 17 Nov 2008 16:01:41 -0500 Message-ID: <4921DBB4.4060505@earthlink.net> Date: Mon, 17 Nov 2008 16:01:40 -0500 From: Stephen Clark User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: freebsd-net@freebsd.org References: <491B2703.4080707@earthlink.net> <491B31F7.30200@elischer.org> <491B4345.80106@earthlink.net> <491B47D2.6010804@elischer.org> <491C2235.4090509@earthlink.net> <1226589468.1976.12.camel@wombat.2hip.net> <491C4EC2.2000802@earthlink.net> <491D6CED.50006@earthlink.net> <491DC28E.80804@elischer.org> <1226688153.1719.23.camel@squirrel.corp.cox.com> <20081115102746.K61259@maildrop.int.zabbadoz.net> In-Reply-To: <20081115102746.K61259@maildrop.int.zabbadoz.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: a437fbc6971e80f61aa676d7e74259b7b3291a7d08dfec797040dbfe5ded6009d701fad992715179350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 208.118.36.229 Cc: FreeBSD Stable Subject: Re: FreeBSD 6.3 gre and traceroute X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sclark46@earthlink.net List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2008 21:01:42 -0000 Bjoern A. Zeeb wrote: > On Fri, 14 Nov 2008, Robert Noland wrote: > > Hi, > >>>>> Also just using gre's without the >>>>> underlying ipsec tunnels seems to >>>>> work properly. > > The reason for this to my knowledge is: > http://www.kame.net/dev/cvsweb2.cgi/kame/freebsd2/sys/netinet/ip_icmp.c#rev1.4 > > > or looking at recent freebsd code: > http://fxr.watson.org/fxr/source/netinet/ip_icmp.c#L164 > Look for M_DECRYPTED. > > Now what happens in your case: > > you receive an IPSec ESP packet, which gets decryped, that sets > M_DECRYPTED on the mbuf passes through various parts, gets up to gre, > gets decapsulated is an IP packet (again) gets to ip_input, TTL > expired, icmp_error and it's still the same mbuf that originally got > the M_DECRYPTED set. Thus the packets is just freed and you never see > anything. > > So thinking about this has nothing to do with gre (or gif for example > as well) in first place. It's arguably that passing it on to another > decapsulation the flag should be cleared when entering gre() for > example. > > The other question of course is why we do not send the icmp error back > even on plain ipsec? Is it because we could possibly leak information > as it's not caught by the policy sending it back? > > /bz > Update: Adding this code in ip_icmp.c makes the traceroute work. case IPPROTO_GRE: hlen += sizeof(struct gre_h); + m->m_flags &= ~(M_DECRYPTED); Steve -- "They that give up essential liberty to obtain temporary safety, deserve neither liberty nor safety." (Ben Franklin) "The course of history shows that as a government grows, liberty decreases." (Thomas Jefferson)