| a06db214 | 25-Aug-2019 |
Cy Schubert <[email protected]> |
MFC r350881:
Calculate the number interface array elements using the new FR_NUM macro instead of the hard-coded value of 4. This is a precursor to increasing the number of interfaces speficied in "o
MFC r350881:
Calculate the number interface array elements using the new FR_NUM macro instead of the hard-coded value of 4. This is a precursor to increasing the number of interfaces speficied in "on {interface, ..., interface}". Note that though this feature is coded in ipf_y.y, it is partially supported in the ipfilter kld, meaning it does not work yet (and is yet to be documented in ipf.5 too).
show more ...
|
| 1f6f0000 | 25-Aug-2019 |
Cy Schubert <[email protected]> |
MFC r350880:
r272552 applied the patch from ipfilter upstream fil.c r1.129 to fix broken ipfilter rule matches (upstream bug #554). The upstream patch was incomplete, it resolved all but one rule co
MFC r350880:
r272552 applied the patch from ipfilter upstream fil.c r1.129 to fix broken ipfilter rule matches (upstream bug #554). The upstream patch was incomplete, it resolved all but one rule compare issue. The issue fixed here is when "{to, reply-to, dup-to} interface" are used in conjuncion with "on interface". The match was only made if the on keyword was specified in the same order in each case referencing the same rule. This commit fixes this.
The reason for this is that interface name strings and comment keyword comments are stored in a a variable length field starting at fr_names in the frentry struct. These strings are placed into this variable length in the order they are encountered by ipf_y.y and indexed through index pointers in fr_ifnames, fr_comment or one of the frdest struct fd_name fields. (Three frdest structs are within frentry.) Order matters and this patch takes this into account.
While in here it was discovered that though ipfilter is designed to pport multiple interface specifiations per rule (up to four), this undocumented (the man page makes no mention of it) feature does not work. A todo is to fix the multiple interfaces feature at a later date. To understand the design decision as to why only four were intended, it is suspected that the decision was made because Sun workstations and PCs rarely if ever exceeded four NICs at the time, this is not true in 2019.
PR: 238796 Reported by: WHR <[email protected]>
show more ...
|
| 01316f97 | 07-Aug-2019 |
Cy Schubert <[email protected]> |
MFC r350568:
Resolve ipfilter kld unload issues related to VNET jails.
When the ipfilter kld is loaded, used within VNET jail, and unloaded, then subsequent loading, use, and unloading of another p
MFC r350568:
Resolve ipfilter kld unload issues related to VNET jails.
When the ipfilter kld is loaded, used within VNET jail, and unloaded, then subsequent loading, use, and unloading of another packet filters will cause the subsequently loaded netpfil kld's to panic.
The scenario is as follows:
cd /usr/tests/sys/netpfil/common
kldunload ipl kldunload pfsync kldunload ipfw
kyua test pass_block
kldload ipl kyua test pass_block kldunload ipl
kldload pfsync kyua test pass_block kldunload pfsync -- page fault panic occurs here --
Reported by: "Ahsan Barkati" <[email protected]> via kp@ Discussed with: kp@ Tested by: kp@
show more ...
|
| 03bcdf44 | 23-Jul-2019 |
Cy Schubert <[email protected]> |
MFC r350063:
Refactor, removing one compare.
This changes the return code however the caller only tests for 0 and != 0. One might ask then, why multiple return codes when the caller only tests for
MFC r350063:
Refactor, removing one compare.
This changes the return code however the caller only tests for 0 and != 0. One might ask then, why multiple return codes when the caller only tests for 0 and != 0? From what I can tell, Darren probably passed various return codes for sake of debugging. The debugging code is long gone however we can still use the different return codes using DTrace FBT traces. We can still determine why the compare failed by examining the differences between the fr1 and fr2 frentry structs, which is a simple test in DTrace. This allows reducing the number of tests, improving the code while not affecting our ability to capture information for diagnostic purposes.
show more ...
|
| c28a7472 | 21-Jul-2019 |
Cy Schubert <[email protected]> |
MFC r349980:
Calculate the offset of the interface name using FR_NAME rather than calclulating it "by hand". This improves consistency with the rest of the code and is in line with planned fixes and
MFC r349980:
Calculate the offset of the interface name using FR_NAME rather than calclulating it "by hand". This improves consistency with the rest of the code and is in line with planned fixes and other work.
show more ...
|
| 14869b72 | 18-Jul-2019 |
Cy Schubert <[email protected]> |
MFC r349898, r349916:
ipfilter commands, in this case ipf(8), passes its operations and rules via an ioctl interface. Rules can be added or removed and stats and counters can be zeroed out. As the i
MFC r349898, r349916:
ipfilter commands, in this case ipf(8), passes its operations and rules via an ioctl interface. Rules can be added or removed and stats and counters can be zeroed out. As the ipfilter interprets these instructions or operations they are stored in an integer called addrem (add/remove). 0 is add, 1 is remove, and 2 is clear stats and counters. Much of this is not documented. This commit documents these operations by replacing simple integers with a self documenting enum along with a few basic comments.
show more ...
|
| 11494514 | 12-Jul-2019 |
Cy Schubert <[email protected]> |
MFC r349929:
Move the new ipf_pcksum6() function from ip_fil_freebsd.c to fil.c. The reason for this is that ipftest(8), which still works on FreeBSD-11, fails to link to it, breaking stable/11 buil
MFC r349929:
Move the new ipf_pcksum6() function from ip_fil_freebsd.c to fil.c. The reason for this is that ipftest(8), which still works on FreeBSD-11, fails to link to it, breaking stable/11 builds.
ipftest(8) was broken (segfault) sometime during the FreeBSD-12 cycle. glebius@ suggested we disable building it until I can get around to fixing it. Hence this was not caught in -current.
The intention is to fix ipftest(8) as it is used by the netbsd-tests (imported by ngie@ many moons ago) for regression testing.
show more ...
|
| fc67bee9 | 12-Jul-2019 |
Cy Schubert <[email protected]> |
MFC r348987, r348989:
Resolve IPv6 checksum errors with stateful inspection. According to PR/203585 this appears to have been broken by r235959, which predates the ipfilter 5.1.2 import into FreeBSD
MFC r348987, r348989:
Resolve IPv6 checksum errors with stateful inspection. According to PR/203585 this appears to have been broken by r235959, which predates the ipfilter 5.1.2 import into FreeBSD.
The IPv6 checksum calculation is incorrect. To resolve this we call in6_cksum() to do the the heavy lifting for us, through a new function ipf_pcksum6(). Should we need to revisit this area again, a DTrace probe is added to aid with future debugging.
Plus whitespace adjustments (r348989).
PR: 203275, 203585 Differential Revision: https://reviews.freebsd.org/D20583
show more ...
|
| 74e0b4b7 | 12-Jul-2019 |
Cy Schubert <[email protected]> |
MFC r348986:
Register pfil hooks when VNET != vnet0. r302298, which virtualized ipf, assumed the pfil hook registration performed in ipf_modload() would take are of this. However ipf_modload() is on
MFC r348986:
Register pfil hooks when VNET != vnet0. r302298, which virtualized ipf, assumed the pfil hook registration performed in ipf_modload() would take are of this. However ipf_modload() is only called when the ipl kld is loaded or when ipfilter is first called when it is statically linked into the kernel at build time.
Prior to this, even though r302298 has been in the tree for a while, it has never been used. So, r302298 in reality begins now.
PR: 212000 Reported by: ahsanb@
show more ...
|
| 440cb60c | 03-Jul-2019 |
Cy Schubert <[email protected]> |
MFC r349401:
While working on PR/238796 I discovered an unused variable in frdest, the next hop structure. It is likely this contributes to PR/238796 though other factors remain to be investigated.
MFC r349401:
While working on PR/238796 I discovered an unused variable in frdest, the next hop structure. It is likely this contributes to PR/238796 though other factors remain to be investigated.
PR: 238796
show more ...
|
| ab109c9b | 03-Jul-2019 |
Cy Schubert <[email protected]> |
MFC r349399-349400,349567-349568:
Prompted by r349366, ipfilter is also does not conform to RFC 3128 by dropping TCP fragments with offset = 1.
In addition to dropping these fragments, add a DTrace
MFC r349399-349400,349567-349568:
Prompted by r349366, ipfilter is also does not conform to RFC 3128 by dropping TCP fragments with offset = 1.
In addition to dropping these fragments, add a DTrace probe to allow for more detailed monitoring and diagnosis if required.
show more ...
|