| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Through fixes and improvements our ipfilter sources have diverged
enough to warrant move from contrib into sys/netpil. Now that I'm
planning on implementing MSS clamping as in iptables it makes more
sense to move ipfilter to netpfil.
This is the first of three commits the ipfilter move.
Suggested by glebius on two occaions.
Suggested by and discussed with: glebius
Reviewed by: glebius, kp (for #network)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33510
|
|
|
|
| |
MFC after: 3 days
|
|
|
|
| |
MFC after: 1 week
|
|
|
|
|
|
| |
ipf_rdx_node.name is only vaild when RDX_DEBUG is defined.
MFC after: 1 week
|
|
|
|
| |
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
| |
The fr_info struct contains a summary of a packet. One of its fields
is a pointer to the ifnet struct the packet arrived on. It is pointed
to by a void* because ipfilter supports multiple O/Ses. Unfortunately
this makes it difficult it examine with DTrace. Defining fin_ifp as a
pointer to an ifnet struct makes the struct it points to using a DTrace
script possible.
MFC after: 1 week
|
|
|
|
| |
MFC after: 3 days
|
|
|
|
|
|
|
|
|
| |
As in 73db3b64f167, when WITHOUT_INET6 is selected, null if-then-else
blocks are generated because #if statements are incorrectly placed.
Moving the #if statements reduces unnecessary runtime comparisons or
compiler optimizations.
MFC after: 3 days
|
|
|
|
|
|
|
| |
Correct a comment to accurately reflect what is being done. While
we're at it document the next step in the process.
MFC after: 3 days
|
|
|
|
|
|
|
| |
As of 874b1a35486b, ip_proxy_check() return codes have been simplified.
The original comment was also incorrect in the first place.
MFC after: 3 days
|
|
|
|
|
|
|
|
| |
Add an SDT probe, using the newly created DT5 macro, in similar vein
to DEBUG_PARSE printf for when FTP junk is anticipated and ok. This
will assist in debugging port (active) FTP proxy issues.
MFC after: 3 days
|
|
|
|
|
|
|
| |
Define a new DT5 DTrace macro used to call DTRACE_PROBE5, for use with
SDT probes with five arguments.
MFC after: 3 days
|
|
|
|
|
|
| |
Clean up whitespace from compaction of DTn macro definitions.
MFC after: 3 days
|
|
|
|
|
|
|
| |
Use a compound #if to simplify and compact DTn DTRACE_PROBEn macros
used by ipfilter.
MFC after: 3 days
|
|
|
|
|
|
|
| |
Rather than save the return code into an intermediate variable, which BTW
is optimized out anyway, explicitly remove the return code from the stack.
MFC after: 3 days
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined;
define it for user level. Define IN_MULTICAST separately from IN_CLASSD,
and use it in pf instead of IN_CLASSD. Stop using class for setting
default masks when not specified; instead, define new default mask
(24 bits). Warn when an Internet address is set without a mask.
MFC after: 1 month
Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D32708
|
|
|
|
|
|
|
|
| |
NAT hash tables are inverted for inbound vs outbound. Rather than spend
the time and cycles swapping them, let's simply calculate the bucket
lengths inversely.
MFC after: 1 week
|
|
|
|
|
|
| |
Correct a comment's grammar and while at it clarify its meaining.
MFC after: 3 days
|
|
|
|
|
|
|
| |
TCP sequence numbers in the FTP proxy are maintained in a two dimensional
array. The debug message prints the same seq[N] for both. Fix that.
MFC after: 3 days
|
|
|
|
|
|
|
| |
Locking of data structures touched by sysctls is more finely locked
in ipflter therefore higher level locks are redundant.
MFC after: 3 days
|
|
|
|
|
|
|
|
| |
When WITHOUT_INET6 is selected we generate a null if-then-else blocks
due to incorrect placment of #if statments. Move the #if statements
reducing unnecessary runtime comparisons WITHOUT_INET6.
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement kernel support for RFC 5549/8950.
* Relax control plane restrictions and allow specifying IPv6 gateways
for IPv4 routes. This behavior is controlled by the
net.route.rib_route_ipv6_nexthop sysctl (on by default).
* Always pass final destination in ro->ro_dst in ip_forward().
* Use ro->ro_dst to exract packet family inside if_output() routines.
Consistently use RO_GET_FAMILY() macro to handle ro=NULL case.
* Pass extracted family to nd6_resolve() to get the LLE with proper encap.
It leverages recent lltable changes committed in c541bd368f86.
Presence of the functionality can be checked using ipv4_rfc5549_support feature(3).
Example usage:
route add -net 192.0.0.0/24 -inet6 fe80::5054:ff:fe14:e319%vtnet0
Differential Revision: https://reviews.freebsd.org/D30398
MFC after: 2 weeks
|
|
|
|
|
|
|
| |
Local commit; ipfilter upstream is inactive.
Discussed with: cy
MFC after: 3 days
|
|
|
|
|
|
|
|
|
| |
Unfortunately the wrong elemet is freed, also resulting in use-after-free.
PR: 255859
Submitted by: lylgood@foxmail.com
Reported by: lylgood@foxmail.com
MFC after: 3 days
|
|
|
|
|
|
|
|
|
|
| |
ipf_proxy_check() returns -1 for an error and 0 or 1 for success.
ipf_proxy_check()'s callers check for error and if the return code
is 0, they change it to 1 prior to returning to their callers. Simply
by returning -1 or 1 we reduce complexity and cycles burned changing
0 to 1.
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LARGE_NAT is a C macro that increases
NAT_SIZE from 127 to 2047,
RDR_SIZE from 127 to 2047,
HOSTMAP_SIZE from 2047 to 8191,
NAT_TABLE_MAX from 30000 to 180000, and
NAT_TABLE_SZ from 2047 to 16383.
These values can be altered at runtime using the ipf -T command however
some adminstrators of large firewalls rebuild the kernel to enable
LARGE_NAT at boot. This revision adds the tunable net.inet.ipf.large_nat
which allows an administrator to set this option at boot instead of build
time. Setting the LARGE_NAT macro to 1 is unaffected allowing build-time
users to continue using the old way.
|
|
|
|
|
|
|
|
|
|
|
|
| |
57785538c6e0d7e8ca0f161ab95bae10fd304047 change the test for FreeBSD
from __FreeBSD_version to __FreeBSD__. However this test was performed
before sys/param.h was included, therefore __FreeBSD_version was never
defined. As the test was never true opt_random_ip_id.h was never included.
Submitted by: bdragon
Reported by: bdragon
MFC after: 1 week
X-MFC with: 57785538c6e0d7e8ca0f161ab95bae10fd304047
|
|
|
|
|
|
|
|
| |
Rather than rely on __FreeBSD_version, defined in sys/param.h, use
__FreeBSD__ defined by the compiler.
Reported by: emaste
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ipfilter NAT table host map size is a tunable that defaults to
a macro value defined at build time. HOSTMAP_SIZE is saved in softn
(the ipnat softc) at initialization. It can be tuned (changed) at runtime
using the ipf -T command. If the hostmap_size tunable is adjusted the
calculation to determine where to put new entries in the table was
incorrect. Use the tunable in the NAT softc instead of the static build
time value.
MFC after: 1 week
|
|
|
|
|
|
| |
All FreeBSD and NetBSD are BSD >= 199306 and have been for a long time.
MFC after: 1 week
|
|
|
|
|
|
|
| |
MENTAT and SOLARIS are synonymous. Remove the extraneous duplicate
macro.
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
| |
The conscious decision was made not to perform any indentation or
whitespace cleanup while cleaning out old redunant #ifdefs. The
reason for this was to avoid confusing future readers of history and
diffs with cosmetic changes, making bisection of any possible bugs
introduced more difficult. This commit cleans up the whitespace
detritus left behind from the previous #ifdef cleanup commits.
MFC after: 1 week
|
|
|
|
|
|
|
|
|
| |
In the old days when K&R C and STD C were each in use a workaround
(read hack) was required to allow the same code to work on each
without modification. All C compilers support STD C. We can finally
put the __P prototype to rest.
MFC after: 1 week
|
|
|
|
|
|
|
|
| |
All C compilers in 2021 support standard C and architectures that did
not were retired long ago. Simplify by removing now redundant
pre-standard C code.
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
| |
Pass the structure offset in arg2 instead of arg1. This avoids
having to undo the pointer arithmetic on arg1. Instead arg2 can
be used directly as an offset relative to the desired structure.
Reviewed by: cy
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D27961
|
|
|
|
|
|
|
|
|
|
|
|
| |
Dynamically created OIDs automatically get this flag set.
Reviewed by: jhb
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D26561
Notes:
svn path=/head/; revision=366433
|
|
|
|
|
|
|
|
|
| |
complete description.
MFC after: 1 week
Notes:
svn path=/head/; revision=366287
|
|
|
|
|
|
|
| |
MFC after: 3 days
Notes:
svn path=/head/; revision=366204
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- make sure frag is initialized to 0
- initialize ipfr_p field
NetBSD PR: 55137
Submitted by: christos@NetBSD.org
Reported by: christos@NetBSD.org
Obtained from: NetBSD fil.c r1.32, ip_frag.c r1.8
MFC after: 2 weeks
Notes:
svn path=/head/; revision=363285
|
|
|
|
|
|
|
|
|
|
|
|
| |
define FASTROUTE_RECURSION in fil.c
Submitted by: christos@NetBSD.org
Reported by: christos@NetBSD.org
Obtained from: NetBSD r1.31
MFC after: 2 weeks
Notes:
svn path=/head/; revision=363284
|
|
|
|
|
|
|
| |
Reviewed by: melifaro (previous version)
Notes:
svn path=/head/; revision=360101
|
|
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=360100
|
|
|
|
|
|
|
|
|
|
|
| |
BSD_GE_YEAR
BSD_GT_YEAR
BSD_LT_YEAR
MFC after: 3 days
Notes:
svn path=/head/; revision=358560
|
|
|
|
|
|
|
|
|
| |
macros.
MFC after: 3 days
Notes:
svn path=/head/; revision=358559
|
|
|
|
|
|
|
|
|
| |
__FreeBSD_version > 3.0 and 5.0 is redundant.
MFC after: 3 days
Notes:
svn path=/head/; revision=358558
|
|
|
|
|
|
|
|
|
|
| |
ipfilter by making it sysctl locking mpsafe.
Reviewed by: kaktus
Differential Revision: https://reviews.freebsd.org/D23839
Notes:
svn path=/head/; revision=358356
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.
Approved by: kib (mentor, blanket)
Differential Revision: https://reviews.freebsd.org/D23628
Notes:
svn path=/head/; revision=358276
|
|
|
|
|
|
|
|
|
|
|
| |
ipf_pcksum6(), directly pass the adddress of the mbuf to it. This reduces
one pointer dereference. ipf_pcksum6() doesn't use the packet information
control block except to obtain the mbuf address.
MFC after: 3 days
Notes:
svn path=/head/; revision=355670
|
|
|
|
|
|
|
|
|
| |
PR: 203275
Reported by: Frank Volf <frank@deze.org>
MFC after: 3 days
Notes:
svn path=/head/; revision=355669
|
|
|
|
|
|
|
|
|
|
| |
l4sums DTrace probe, making more information available for the diagnosis
of IPv6 checksum errors.
MFC after: 3 days
Notes:
svn path=/head/; revision=355156
|