Commit Graph

9927 Commits

Author SHA1 Message Date
Reid Linnemann
0abcc1d2d3 pf: Add per-rule timestamps for rule and eth_rule
Similar to ipfw rule timestamps, these timestamps internally are
uint32_t snaps of the system time in seconds. The timestamp is CPU local
and updated each time a rule or a state associated with a rule or state
is matched.

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34970
2022-04-22 19:53:20 +02:00
Alexander Leidinger
b75644771a Add nullfs specific nocache option. 2022-04-22 10:22:26 +02:00
Kristof Provost
c90f8cb899 pfctl tests: fix Ethernet output expectations
Since a16732d670 we always print the l3 src/destination for Ethernet
rules. Update the tests to account for this.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-21 10:26:00 +02:00
Warner Losh
b91a48693a ifconfig: Fix spelling error
s/discreet/discrete

Reported by: Diane Bruce
2022-04-20 17:57:42 -06:00
Kristof Provost
a16732d670 pfctl: always print 'l3' source/destination
While the kernel only performs the L3 check for
ETHERTYPE_IP/ETHERTYPE_IP6 we should always print the source and
destination addresses.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34918
2022-04-20 13:01:12 +02:00
Kristof Provost
812839e5aa pf: allow the use of tables in ethernet rules
Allow tables to be used for the l3 source/destination matching.
This requires taking the PF_RULES read lock.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34917
2022-04-20 13:01:12 +02:00
Piotr Pawel Stefaniak
d399eb3ef7 ping: split the visual part of -f into a new option -.
After this, we'll be able to ping a host and not spam the terminal, and
no flooding will have to be involved. I've been doing this under Linux
as ping -fi1 host.

Reviewed by:	rpokala, Pau Amma
Differential Revision:	https://reviews.freebsd.org/D34882
2022-04-18 18:10:50 +02:00
Mitchell Horne
0a5c04a892 savecore: add an option to save a live minidump
The new '-L' flag will cause savecore to invoke the new mem(4) kernel
dump ioctl, taking a dump of the running system and writing the result
to a temporary file. Validation of the dump header is performed, similar
to regular crash dumps, and the final result is written to
livecore.X[.zst|.gz].

Also added is the '-Z' flag, which instructs the kernel to compress the
livedump compressed with zstd, akin to the existing -z flag. This option
has no effect in normal savecore(8) operation, but in theory could be
extended to perform such compression while reading the dump from the
dump device.

Encryption is unsupported for live dumps.

For example: 'savecore -Lz /var/crash' would create:
/var/crash/livecore.0.gz

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34347
2022-04-18 12:56:16 -03:00
Mitchell Horne
cf02cf8dbf savecore: factor out info file handling
Move it to a separate function, allowing its reuse.

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34822
2022-04-18 12:56:15 -03:00
Mitchell Horne
fafeb5342b savecore: decrease filename buffer sizes
All files are now created relative to savedirfd, e.g. with openat(2).
Therefore, we do not need character buffers to be PATH_MAX bytes long,
just long enough to hold the complete filename. 32 bytes is long enough
in all cases. These can be allocated on the stack.

While here, fix an error message that attempts to use an uninitialized
infoname.

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34821
2022-04-18 12:56:15 -03:00
Mitchell Horne
4243d307d3 savecore: fold maxdumps check into getbounds()
So that new callers of getbounds() don't need to duplicate it.

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34783
2022-04-18 12:56:15 -03:00
Matteo Riondato
d86cf44350 pfctl: fix recursive printing of rules
When asked to print rules recursively, correctly recurse for anchors
included in pf.conf with "anchorname/*".

PR:		262590
Reviewed by:	kp
MFC after:	3 weeks
2022-04-14 17:25:41 +02:00
Mateusz Piotrowski
632ea8ea98 ifconfig.8: Note that -l accepts -g in addition to -d and -u
Fixes:	5533c5046a ifconfig.8: Update -l synopsis
MFC after:	3 days
2022-04-11 20:05:36 +02:00
Mateusz Guzik
a3214fbe7f mount: use pidfile_signal
This fixes a performance problem where poudriere -j 104 keeps remounting
filesystems, which induce wanting to signal mountd, if running. The
current code tries to do it by creating the pidfile in /var/run and
unlinking it if the operation succeeds, inducing contention against
anything doing an exec as it tries to look up /var/run/ld-elf.so.hints

Differential Revision:	https://reviews.freebsd.org/D34681
2022-04-09 15:59:43 +00:00
Gordon Bergling
299fcf402d fsck_ffs(8): Fix a typo in a source code comment
- s/it it/if it/

MFC after:	3 days
2022-04-09 14:38:00 +02:00
Gordon Bergling
009727ed57 routed(8): Remove a double word in a source code comment
- s/it it/it/

MFC after:	3 days
2022-04-09 14:36:20 +02:00
Gordon Bergling
b95a6ecffa hastd(8): Fix a typo in a source code comment
- s/proccesses/processes/

MFC after:	3 days
2022-04-09 14:06:30 +02:00
Gordon Bergling
efb45ad024 umount(8): Remove a double word in a source code comment
- s/this this/this/

MFC after:	3 days
2022-04-09 10:13:45 +02:00
Gordon Bergling
d7958fe1bc ipnat(5): Fix a double word in the manual page
- s/be be/be/

MFC after:	3 days
2022-04-09 09:28:43 +02:00
Gordon Bergling
a06052d623 dhclient(8): Fix a typo in a source code comment
- s/explicitely/explicitly/

MFC after:	3 days
2022-04-09 09:28:06 +02:00
Mitchell Horne
173fc6f456 savecore: include '-u' flag in usage message
Reported by:	Pau Amma <pauamma@gundo.com>
Fixes		bc7ed46b63 ("Add '-u' switch that would...")
MFC after:	3 days
2022-04-05 16:23:02 -03:00
Reid Linnemann
4823489ab6 libpfctl: relocate implementations of pfr_add/get/set_addrs
Reviewed by:	kp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34740
2022-04-04 19:14:23 +02:00
Kyle Evans
dadb9c7093 bectl: push space-in-name check down into libbe
This check was previously in `create` only, not applying to renames.  It
should really be applied at the libbe level, so that we can avoid
writing about this restriction over and over again.

While we're here: `bectl rename` always succeeds, even when it doesn't.
Start returning the error.

Reported By:	Christian McDonald <cmcdonald netgate com>
Reviewed by:	rew, jwmaag_gmail.com (earlier version)
Differential Revision:	https://reviews.freebsd.org/D34605
2022-04-02 21:04:31 -05:00
Gordon Bergling
8a3568b584 ipf(5): Fix a typo in the manual page
- s/accomodate/accommodate/

MFC after:	3 days
2022-04-02 14:50:45 +02:00
Gordon Bergling
e09d161bd9 devd(8): Fix a typo in a configuration file
- s/coresponding/corresponding/

MFC after:	3 days
2022-04-02 11:52:26 +02:00
Mateusz Guzik
c4a08ef2af pf: handle duplicate rules gracefully
Reviewed by:	kp
Reported by:	dch
PR:		262971
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-01 18:01:48 +00:00
Kyle Evans
c0f846ff23 bectl: add some discussion about boot environment layouts
Discuss the standard type of layout, as well as the "deep" BE layout,
and some of the properties of both.  Point the various -r flags at this
new section, to help users understand which they're working with and
what the -r flag is actually doing. Note that we may just deprecate the
-r flag in future versions, but the flag will be recognized as a NOP at
that point.

Reviewed by:	pauamma_gundo.com, rew
Differential Revision:	https://reviews.freebsd.org/D34538
2022-03-31 17:42:33 -05:00
Mateusz Piotrowski
5533c5046a ifconfig.8: Update -l synopsis
The -g flag can be used together with the -l flag.

MFC after:	2 weeks
2022-03-31 17:12:27 +02:00
Mateusz Piotrowski
4d91c53a78 ifconfig.8: Document "ifconfig -g groupname"
"ifconfig -g groupname" prints a list of interface names,
which could be confusing, because it differs from
the behavior of "ifconfig -a -g groupname".

While here, add two examples showing the difference between
"ifconfig -a -g groupname" and "ifconfig -g groupname".

Fixes:	0dad3f0e15 Import interface groups from OpenBSD.
MFC after:	2 weeks
2022-03-31 17:07:15 +02:00
Mateusz Piotrowski
e57f6630d9 ifconfig.8: Remove commented-out Xr eon 5
This reference has been present in the manual page since the initial
import of BSD 4.4 Lite sbin Sources. It's time for it to be removed.

MFC after:	2 weeks
2022-03-31 12:07:18 +02:00
Mateusz Piotrowski
1969cc7bdc ifconfig.8: Remove remaining Xerox Network Systems(tm) bits
Support for Xeros Network Systems seems to be long gone. There is no
reason to keep this in the manual page.

MFC after:	2 weeks
2022-03-31 12:00:42 +02:00
Mateusz Piotrowski
19ac0bc5c1 ifconfig.8: Simplify examples by using canonical parameters
Also, use Bd instead of Dl for multi line examples.

MFC after:	2 weeks
2022-03-31 11:54:06 +02:00
Mateusz Piotrowski
2cd28d6f9b ifconfig.8: Mark address_family as optional in synopsis
Commands like "ifconfig wlan0 up" are valid. There is no need to always
specify the address family.

MFC after:	2 weeks
2022-03-31 11:43:18 +02:00
Mateusz Piotrowski
3049aac91b ifconfig.8: Improve description of the address argument
- Split paragraphs for clarity.
- Add an example of setting a random MAC address.

MFC after:	2 weeks
2022-03-31 11:43:18 +02:00
Mateusz Piotrowski
ad8cac1229 ifconfig.8: Improve readability of address_family documentation
Also, move the description of the special case of "ifconfig -l ether" to
the description of the -l flag.

MFC after:	2 weeks
2022-03-31 11:43:17 +02:00
Jose Luis Duran
607eed2f84 ifconfig.8: Fix quoting
Obtained from:	67d77afb0d (r69907135)
Fixes:		67d77afb0d ifconfig.8: Do not use ``'' for quoting
MFC after:	2 weeks
2022-03-30 17:43:13 +02:00
Mateusz Piotrowski
388c12e3f4 ifconfig.8: Clean up markup of "state" parameter
MFC after:	2 weeks
2022-03-30 14:58:39 +02:00
Mateusz Piotrowski
39da6db9bc ifconfig.8: Make the -f flag description compact
- Remove extraneous examples
- Apply "-compact" to the list macros so that it is possible to fit the
  definitions of the types and formats in one terminal screen.

MFC after:	2 weeks
2022-03-30 14:58:39 +02:00
Mateusz Piotrowski
67d77afb0d ifconfig.8: Do not use ``'' for quoting
MFC after:	2 weeks
2022-03-30 14:58:38 +02:00
Mateusz Piotrowski
ce03846373 ifconfig.8: Clean up the channel parameter description
MFC after:	2 weeks
2022-03-30 14:58:38 +02:00
Mateusz Piotrowski
0e2045b294 ifconfig.8: Add section headers to the parameters section
MFC after:	2 weeks
2022-03-30 14:58:37 +02:00
Mateusz Piotrowski
186a372f24 ifconfig.8: Clean up -n documentation
MFC after:	2 weeks
2022-03-30 14:58:37 +02:00
Mateusz Piotrowski
9076f99b9b ifconfig.8: Clean up -k documentation
MFC after:	2 weeks
2022-03-30 14:58:36 +02:00
Mateusz Piotrowski
59cdaadcf6 ifconfig.8: Clean up -C and -v documentation
MFC after:	2 weeks
2022-03-30 14:58:36 +02:00
Mateusz Piotrowski
fe1e3b55f2 ifconfig.8: Clean up -l documentation
MFC after: 2 weeks
2022-03-30 14:58:35 +02:00
Mateusz Piotrowski
787599088b ifconfig.8: Clean up -G & -g documentation
MFC after:	2 weeks
2022-03-30 14:58:35 +02:00
Mateusz Piotrowski
0625c31391 ifconfig.8: Clean up documentation of -a, -d, and -u
MFC after:	2 weeks
2022-03-30 14:58:34 +02:00
Mateusz Piotrowski
19c1b75f71 ifconfig.8: Clean up -L documentation
MFC after:	2 weeks
2022-03-30 14:58:34 +02:00
Mateusz Piotrowski
b56e4224e9 ifconfig.8: Clean up -m documentation
MFC after: 2 weeks
2022-03-30 14:58:33 +02:00
Mateusz Piotrowski
f4f02fa1e3 ifconfig.8: Clean up formatting of -f documentation
This change is about moving the -f documentation into the right place in
the manual. Also, document the IFCONFIG_FORMAT variable in the
ENVIRONMENT section.

MFC after:	2 weeks
2022-03-30 14:58:33 +02:00