From owner-freebsd-bugs@freebsd.org Wed Oct 4 08:01:09 2017 Return-Path: Delivered-To: freebsd-bugs@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 2FF06E31D8B for ; Wed, 4 Oct 2017 08:01:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 1E3EF76757 for ; Wed, 4 Oct 2017 08:01:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v94818cx036241 for ; Wed, 4 Oct 2017 08:01:08 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 222768] ipfw can't distinguish an inbound packets forwarded via if_bridge Date: Wed, 04 Oct 2017 08:01:09 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: alex@zagrebin.ru X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 08:01:09 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D222768 Bug ID: 222768 Summary: ipfw can't distinguish an inbound packets forwarded via if_bridge Product: Base System Version: 11.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: alex@zagrebin.ru Created attachment 186898 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D186898&action= =3Dedit patch By default (when net.link.bridge.pfil_bridge=3D1), the packet, forwarded via if_bridge, has to be processed by ipfw 4 times. Suppose such configuration: em0 <-> bridge0 <-> em1 ipfw will process packet, forwarded from em0 to em1, in the following seque= nce: in[em0], in[bridge0], out[bridge0], out[em1]. We can expect, that inbound packets can be matched with the following ipfw = rule options: in[em0] - 'in recv em0' or 'in via em0' in[bridge0] - 'in via bridge0' For example, ipfw add 1 count ip from any to any in via em0 ipfw add 2 count ip from any to any in via bridge0 but this doesn't work as expected: each single packet matches 2 times to the rule 1 and not matches to the rule 2 at all. The reason in the following: despite that if_bridge sends information about corresponding interface to the pfil_run_hooks(), the ipfw doesn't uses it w= hile processing inbound packets. The attached patch fixes issue: If the interface on which ipfw processes packet does not match an 'received' interface, then this interface saved and used later in the processing of 'v= ia' rule option. --=20 You are receiving this mail because: You are the assignee for the bug.=