From nobody@FreeBSD.org  Sun Jan 13 19:07:34 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 8871C25E
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Jan 2013 19:07:34 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 60F2F6AC
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Jan 2013 19:07:34 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DJ7YbW032053
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Jan 2013 19:07:34 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r0DJ7YNq032052;
	Sun, 13 Jan 2013 19:07:34 GMT
	(envelope-from nobody)
Message-Id: <201301131907.r0DJ7YNq032052@red.freebsd.org>
Date: Sun, 13 Jan 2013 19:07:34 GMT
From: Nikita <cnik87@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pf + tap keep state problem
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         175267
>Category:       kern
>Synopsis:       [pf] [tap] pf + tap keep state problem
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 13 19:10:01 UTC 2013
>Closed-Date:    
>Last-Modified:  Mon Jan 14 08:44:53 UTC 2013
>Originator:     Nikita
>Release:        FreeBSD 9.0 RELEASE amd64
>Organization:
>Environment:
FreeBSD platforma.local 9.0-RELEASE FreeBSD 9.0-RELEASE #1: Sun Jan 13 21:36:47 ALMT 2013     root@platforma.local:/usr/obj/usr/src/sys/PLATFORMA  amd64
>Description:
I have problem with PF and tap interface, pf not correctly work with keep state rule.


after opening ssh connection to ip routed to tap in /var/log/messages show this messages:

Jan 14 01:03:03 platforma kernel: pf: loose state match: TCP in wire: 10.6.0.30:44862 192.168.7.11:22 stack: - [lo=1659601007 high=1659599728 win=4326 modulator=0] [lo=0 high=4326 win=1 modulator=0] 2:0 A seq=1659601007 (1659601007) ack=0 len=0 ackskew=0 pkts=12:1 dir=in,fwd
Jan 14 01:03:03 platforma kernel: pf: loose state match: TCP out wire: 192.168.7.11:22 10.6.0.30:44862 stack: - [lo=1659601007 high=1659599728 win=4326 modulator=0] [lo=0 high=4326 win=1 modulator=0] 2:0 A seq=1659601007 (1659601007) ack=0 len=0 ackskew=0 pkts=12:0 dir=out,fwd
Jan 14 01:03:03 platforma kernel: pf: BAD ICMP 5:1 10.6.0.1 -> 10.6.0.30 state: TCP in wire: 10.6.0.30:44862 192.168.7.11:22 stack: - [lo=1659601007 high=1659599728 win=4326 modulator=0] [lo=0 high=4326 win=1 modulator=0] 2:0 seq=1659601007
Jan 14 01:03:05 platforma kernel: pf: OK ICMP 5:1 10.6.0.1 -> 10.6.0.30 state: TCP in wire: 10.6.0.30:44892 192.168.7.11:22 stack: - [lo=3982164082 high=3982164084 win=2048 modulator=0] [lo=0 high=1 win=1 modulator=0] 2:0 seq=3982164082


pfctl -ss | grep 192.168.7.11
all tcp 192.168.7.11:22 <- 10.6.0.30:44892       CLOSED:SYN_SENT
all tcp 10.6.0.30:44892 -> 192.168.7.11:22       SYN_SENT:CLOSED



and connection with ssh closed after ~ 60 sec

>How-To-Repeat:
in pf.conf:
vpn_if = "tap0"


block on $vpn_if from any to any
pass  on $vpn_if from any to any  keep state
pass out on $vpn_if all keep state

route cmd:
route add 192.168.0.0/16 10.6.0.2

from 10.6.0.30 open TCP connection to 192.168.7.11:ssh
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-amd64->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Jan 14 08:44:16 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

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