| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55273
|
| |
|
|
| |
MFC after: 3 days
|
| |
|
|
|
|
|
| |
rulese -> ruleset
MFC after: 3 days
X-MFC-with: a7b8a5d37bcb0009297962137bfb6c6570e5af12
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A mark set with "setmark" keyword is intended to be "sticky"
and documented as such but in fact it is not yet,
as current implementation lacks "sticky" feature
and its implementation will be not MFC'd, most probably.
Correct the manual page until the implementation improved.
MFC after: 3 days
Discussed with: Boris Lytochkin <lytboris@gmail.com> (author)
|
| |
|
|
|
|
|
|
|
|
|
| |
Dynamically allocate bpf tap points for every rule that has "log".
The name is "ipfw%u", where %u is substituted to the rule number.
The default catch all "ipfw0" tap still exists for compatibility
and it will catch packets in case if there are no bpf listeners
on a per-rule tap.
Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D53877
|
| |
|
|
|
|
|
| |
As a free bonus the tapping points are now able to match packet direction.
Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D53875
|
| |
|
|
|
|
|
|
|
|
|
|
| |
ESP is "Encapsulating Security Payload",
not "Encapsulated Security Payload".
This patch fixes all the place in the tree I could find
with `grep -i encapsulated security`.
MFC after: 3 days
Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D53769
|
| |
|
|
|
|
|
|
|
|
| |
All of the do_cmd() calls are in dummynet.c and specify the socket
option at compile time; none of these removed cases are used in ipfw
after the v3 work.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53378
|
| |
|
|
|
|
|
|
|
| |
The failed allocation in the error pertains to IP_FW_XADD, not
IP_FW_ADD.
Reviewed by: ae
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53359
|
| |
|
|
|
|
|
|
| |
IP_DUMMYNET_GET is no longer used in ipfw(1).
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53348
|
| |
|
|
|
|
|
|
|
| |
Dummynet v3 switched to IP_DUMMYNET3 but did not update these
warnings/errors.
Fixes: cc4d3c30ea28 ("Bring in the most recent version of ipfw and dummynet, developed")
Sponsored by: The FreeBSD Foundation
Differential Revision: sbin/ipfw/ipfw2.c
|
| |
|
|
|
|
|
|
|
|
|
| |
table_do_modify_record() already uses errno value on error.
Also this fixes problem when `ipfw table add` returns ENOTTY that
is unrelated to operation.
Tested by: dhw
Fixes: 09025a714708
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53050
|
| |
|
|
|
|
|
|
| |
Commit 4a77657cbc01 increased the size of several opcodes to ipfw_insn_u32.
Approved by: ae
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D52876
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
If the user specified a prefix length with either the internal or
external prefix, we'd jump to check_prefix where we'd dereference p
which was most likely uninitialized.
Instead, store the various prefix lengths separately and check them
all after the loop.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D50597
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Subtracting unsigned and signed types of the same rank yields an
unsigned value that is never less than 0. Rewrite the checks to use
the pattern of 'if (msglen < <desired size>)' instead of
'if (msglen - <desired_size> < 0)' to avoid the subtraction.
To avoid adding lots of casts to appease -Wsign-compare, use a
separate ssize_t variable for the return value of read(2) and convert
msglen to size_t.
While here, fix the first check against the size of the route message
header which was inverted and would have rejected all valid messages
if not for the unsigned vs signed bug causing all of the checks to be
broken.
sbin/ipfw/ipfw2.c: In function 'ipfw_rtsock_monitor':
sbin/ipfw/ipfw2.c:6088:43: error: comparison of unsigned expression in '< 0' is always false [-Werror=type-limits]
6088 | if (sizeof(*hdr) - msglen < 0)
| ^
Reported by: GCC -Wtype-limits
Fixes: 3c76623ad553 ("ipfw: add 'internal monitor' subcommand to capture rtsock messages.")
|
| |
|
|
|
|
| |
cast to unsigned type to fix warning.
Fixes: 3c76623ad553
|
| |
|
|
|
|
|
|
|
| |
This command is similar to route(8) monitor subcommand. It can be
used for debugging rules in run-time.
Also add __pritflike() to bprintf function and fix some related bugs.
Obtained from: Yandex LLC
Sponsored by: Yandex LLC
|
| |
|
|
|
|
|
|
|
| |
Also fix some problems reported by mandoc -T lint.
Add a comment describing the format of rtsock messages.
Submitted by: Boris Lytochkin <lytboris at gmail com>
Obtained from: Yandex LLC
Sponsored by: Yandex LLC
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes ABI due to the changed opcodes and includes the
following:
* rule numbers and named object indexes converted to 32-bits
* all hardcoded maximum rule number was replaced with
IPFW_DEFAULT_RULE macro
* now it is possible to grow maximum numbers or rules in
build time
* several opcodes converted to ipfw_insn_u32 to keep rulenum:
O_CALL, O_SKIPTO
* call stack modified to keep u32 rulenum. The behaviour of
O_CALL opcode was changed to avoid possible packets looping.
Now when call stack is overflowed or mbuf tag allocation
failed, a packet will be dropped instead of skipping to next
rule.
* 'return' action now have two modes to specify return point:
'next-rulenum' and 'next-rule'
* new lookup key added for O_IP_DST_LOOKUP opcode 'lookup rulenum'
* several opcodes converted to keep u32 named object indexes
in special structure ipfw_insn_kidx
* tables related opcodes modified to use two structures:
ipfw_insn_kidx and ipfw_insn_table
* added ability for table value matching for specific value type
in 'table(name,valtype=value)' opcode
* dynamic states and eaction code converted to use u32 rulenum
and named objects indexes
* added insntod() and insntoc() macros to cast to specific
ipfw instruction type
* default sockopt version was changed to IP_FW3_OPVER=1
* FreeBSD 7-11 rule format support was removed
* added ability to generate special rtsock messages via log opcode
* added IP_FW_SKIPTO_CACHE sockopt to enable/disable skipto cache.
It helps to reduce overhead when many rules are modified in batch.
* added ability to keep NAT64LSN states during sets swapping
Obtained from: Yandex LLC
Relnotes: yes
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D46183
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
If rule was added in compact form and rule body is empty, print
'proto ip' opcode to be compatible with ipfw(8) syntax parser.
Before:
$ ipfw add allow proto ip
000700 allow
After:
$ ipfw add allow proto ip
000700 allow proto ip
MFC after: 1 week
|
| |
|
|
|
|
|
|
| |
Enable support for endpoint-independent mapping ("full cone NAT") via
Libalias's UDP NAT.
Reviewed by: igoro, thj
Differential Revision: https://reviews.freebsd.org/D46689D
|
| |
|
|
|
|
|
| |
This is a residual of the $FreeBSD$ removal.
MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
| |
Let ipfw(8) report the actual error instead of the error that
may have come from calling printf().
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1221
|
| |
|
|
|
| |
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
|
| |
|
|
|
|
|
|
| |
Remove repeated words in error message.
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/887
|
| |
|
|
|
|
|
|
|
|
|
| |
Have a simple Gilbert-Elliott channel model in
dummynet to mimick correlated loss behavior of
realistic environments. This allows simpler testing
of burst-loss environments.
Reviewed By: tuexen, kp, pauamma_gundo.com, #manpages
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D42980
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
|
| |
Move the descriptions of loader tunables from section 'SYSCTL VARIABLES'
to section 'LOADER TUNABLES'.
See also 49197c391b3d (ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables).
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D41981
|
| |
|
|
| |
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
|
| |
|
|
| |
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
| |
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| |
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| |
|
|
|
| |
Reported by: GCC
Differential Revision: https://reviews.freebsd.org/D40654
|
| | |
|
| |
|
|
|
|
|
| |
This is a prerequsite for splitting compile_rule() into smaller
chunks.
MFC after: 2 weeks
|
| |
|
|
| |
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
|
| |
Remove "goto charg" from the action parser.
This is a prerequisite for the further split of the gigantic
compile_rule().
Differential Revision: https://reviews.freebsd.org/D40490
MFC after: 2 weeks
|
| |
|
|
|
| |
Differential Revision: https://reviews.freebsd.org/D40488
MFC after: 2 weeks
|
| |
|
|
|
|
| |
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653
|
| |
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Packet Mark is an analogue to ipfw tags with O(1) lookup from mbuf while
regular tags require a single-linked list traversal.
Mark is a 32-bit number that can be looked up in a table
[with 'number' table-type], matched or compared with a number with optional
mask applied before comparison.
Having generic nature, Mark can be used in a variety of needs.
For example, it could be used as a security group: mark will hold a security
group id and represent a group of packet flows that shares same access
control policy.
Reviewed By: pauamma_gundo.com
Differential Revision: https://reviews.freebsd.org/D39555
MFC after: 1 month
|
| |
|
|
|
|
|
|
| |
The manual describes "if*" form only while kernel uses fnmatch(3)
and allows use for more versatile shell-like patterns.
Note that explicitly and provide an example.
MFC after: 3 days
|
| | |
|
| |
|
|
|
|
|
|
| |
It was renamed during review of D1776 but this entry slipped through.
PR: 243284
Reported by: pprocacci@gmail.com
Obtained from: Chad Jacob Milios <milios@ccsys.com>
|
| |
|
|
|
|
|
|
| |
Per RFC 5865, add the 'va' (VOICE-ADMIT, 101100) symbolic name.
Reviewed By: melifaro, pauamma
Differential Revision: https://reviews.freebsd.org/D37508
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
| |
Running "dnctl" vs "/sbin/dnctl" gave different results, because we
looked at the entire argv[0] string, rather than the basename.
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D37431
|
| |
|
|
|
| |
Reviewed by: ae, pauamma
Differential revision: https://reviews.freebsd.org/D36140
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By analogy with IP address matching, add a way to use ipfw radix
tables for MAC matching. This is implemented using new ipfw table
with mac:radix type. Also there are src-mac and dst-mac lookup
commands added.
Usage example:
ipfw table 1 create type mac
ipfw table 1 add 11:22:33:44:55:66/48
ipfw add skipto tablearg src-mac 'table(1)'
ipfw add deny src-mac 'table(1, 100)'
ipfw add deny lookup dst-mac 1
Note: sysctl net.link.ether.ipfw=1 should be set to enable ipfw
filtering on L2.
Reviewed by: melifaro
Obtained from: Yandex LLC
MFC after: 1 month
Relnotes: yes
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D35103
|
| |
|
|
| |
MFC after: 1 week
|