From owner-freebsd-pf@freebsd.org Sat May 21 20:20:21 2016 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 620E0B4570A for ; Sat, 21 May 2016 20:20:21 +0000 (UTC) (envelope-from maximos@als.nnov.ru) Received: from mx.als.nnov.ru (mx.als.nnov.ru [95.79.102.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EA2411F7 for ; Sat, 21 May 2016 20:20:20 +0000 (UTC) (envelope-from maximos@als.nnov.ru) Received: from [10.4.1.100] by mx.als.nnov.ru with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2 (FreeBSD)) (envelope-from ) id 1b4DNi-000BuM-33; Sat, 21 May 2016 23:20:18 +0300 Subject: Re: Bug 201519 To: freebsd-pf@freebsd.org References: <20160521195406.GO15034@home.opsec.eu> From: Max Message-ID: <8412061b-2bd3-0cc0-fc9f-99b81c653aae@als.nnov.ru> Date: Sat, 21 May 2016 23:20:17 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160521195406.GO15034@home.opsec.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 20:20:21 -0000 Hi, Kurt. It`s incomplete. I have tested only the case when inner packet is UDP. Other cases should be tested I think. Actually the patch was mentioned in Alexey's message (http://openbsd-archive.7691.n7.nabble.com/system-6564-pf-not-nating-does-not-see-icmp4-port-unreachable-packets-from-machine-behind-pf-td187997.html). Someone with more experience (then me) should review this patch. 21.05.2016 22:54, Kurt Jaeger пишет: > Hi! > >> I have patched and tested "case IPPROTO_UDP". It works. Other cases >> should work too I think. >> >> It's against releng/10.3 >> --- sys/netpfil/pf/pf.c.orig 2016-05-21 17:57:29.420602000 +0300 >> +++ sys/netpfil/pf/pf.c 2016-05-21 18:01:09.119724000 +0300 >> @@ -4866,8 +4866,7 @@ pf_test_state_icmp(struct pf_state **sta >> &nk->addr[pd2.didx], pd2.af) || >> nk->port[pd2.didx] != uh.uh_dport) >> pf_change_icmp(pd2.dst, >> &uh.uh_dport, >> - NULL, /* XXX Inbound NAT? */ >> - &nk->addr[pd2.didx], >> + saddr, &nk->addr[pd2.didx], >> nk->port[pd2.didx], &uh.uh_sum, >> pd2.ip_sum, icmpsum, >> pd->ip_sum, 1, pd2.af); >> > Can you add this patch to the PR you mention ? >