[Bug 222768] ipfw can't distinguish an inbound packets forwarded via if_bridge
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Oct 4 08:01:09 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222768
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 at FreeBSD.org
Reporter: alex at zagrebin.ru
Created attachment 186898
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=186898&action=edit
patch
By default (when net.link.bridge.pfil_bridge=1), 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 sequence:
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 while
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 'via'
rule option.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list