Commit graph

290629 commits

Author SHA1 Message Date
Mark Johnston 77c3e564b4 ptrace tests: Fix a signed/unsigned integer comparison
Reported by:	Jenkins
Fixes:	43b4da4411 ("ptrace tests: Add a test using PROC_REAP_KILL to kill a traced debuggee")
2024-04-01 19:12:50 -04:00
Michael Tuexen b600644fdd tcp hpts: improve consistency
The target_slot argument of max_slots_available() can be NULL.
Therefore, check for this in all places.
Right now, all callers provide non-NULL pointer.

Reported by:		Coverity Scan
CID:			1527732
Reviewed by:		rrs
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D44527
2024-04-01 21:51:59 +02:00
Dag-Erling Smørgrav dd286b0dc1 cp: Improved conformance when copying directories.
* When copying a directory, if the destination exists and is not a
  directory, we would previously emit an error message and exit.  The
  correct behavior according to POSIX is to emit an error message and
  continue without descending further into the source directory.

* When copying a directory, if the destination does not exist and we
  fail to create it, we would previously emit an error message and
  exit.  The correct behavior according to POSIX is to emit an error
  message and continue.  Whether to descend further into the source
  directory is explicitly left unspecified; GNU cp does not, which
  seems to me to be the safer and less surprising option, so let's not
  either.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44577
2024-04-01 19:29:31 +02:00
Dag-Erling Smørgrav aaa1806f68 cp: Correct the list of non-portable flags.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44576
2024-04-01 19:29:31 +02:00
Mark Johnston 63613e3ba1 wg: Use ENETUNREACH when transmitting to a non-existent peer
The old errno value used is specifically for Capsicum and shouldn't be
co-opted in this way.  It has special handling in the generic syscall
layer (see syscallret()).  OpenBSD returns ENETUNREACH in this case;
let's do the same thing.

Reviewed by:	kevans, imp
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D44582
2024-04-01 13:23:32 -04:00
Dag-Erling Smørgrav 125c4560bc usr.bin: Make lorder conditional on MK_TOOLCHAIN.
MFC after:	1 week
Reviewed by:	allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D44558
2024-04-01 15:18:35 +02:00
Eugene Grosbein 319a5d086b if_bridge: use IF_MINMTU
Replace incorrect constant 576 with IF_MINMTU to check for minumum MTU.
This unbreaks bridging tap interfaces with small mtu.

MFC after:	1 week
2024-04-01 10:35:59 +07:00
Florian Walpen ee36e7face snd_hdspe(4): Only buffer_copy() audio data once.
Instead of blindly copying two periods of audio data to and from DMA
buffers, keep track of the writing position and derive the actual
part of audio data that needs to be copied.
This approximately halves the number of samples copied in total.

Differential Revision:	https://reviews.freebsd.org/D44084
2024-03-31 20:14:16 +01:00
Rick Macklem fefb7c399b mountd.c: Add warning messages for administrative controls
When "administrative controls" (which are exports of subdirectories
within a NFS server's local file system) are used, they export the
entire local server file system. (The subdirectory only applies to
the Mount protocol used for NFSv3 mounts.)

To minimize the risk that this causes confusion w.r.t. what is exported
to NFS client(s), this patch generates warning messages for these.
Only one message is generated for each server local file system.
The messages can be silenced via a new "-A" command line option.

The mountd.8 man page will be patched via a separate commit.

Reviewed by:	emaste, markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D44502
2024-03-31 12:00:08 -07:00
Maxim Konovalov ad5ec5136b bsd-family-tree: remove EoL whitespace 2024-03-31 18:36:03 +00:00
Maxim Konovalov 07b17a1692 bsd-family-tree: add NetBSD 10.0 2024-03-31 18:35:02 +00:00
Mark Johnston 7ef5c19b21 kern linker: Don't invoke dtors without having invoked ctors
I have a kernel module which fails to load because of an unrecognized
relocation type.  link_elf_load_file() fails before the module's ctors
are invoked and it calls linker_file_unload(), which causes the module's
dtors to be executed, resulting in a kernel panic.

Add a flag to the linker file to ensure that dtors are not invoked if
unloading due to an error prior to ctors being invoked.

At the moment I only implemented this for link_elf_obj.c since
link_elf.c doesn't invoke dtors, but I refactored link_elf.c to make
them more similar.

Fixes:		9e575fadf4 ("link_elf_obj: Invoke fini callbacks")
Reviewed by:	zlei, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D44559
2024-03-31 14:15:11 -04:00
Mark Johnston 43b4da4411 ptrace tests: Add a test using PROC_REAP_KILL to kill a traced debuggee
This exercises the bug fix in commit 9241ebc796
("thread_single(9): decline external requests for traced or debugger-stopped procs").

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D44564
2024-03-31 14:11:47 -04:00
Ed Maste d68c68693e tar: make error reporting more robust and use correct errno
Apply upstream pull request 2101.
2024-03-31 10:39:53 -04:00
Christos Margiolis 9eff58c6d5 sound: Implement asynchronous device detach
Hot-unplugging a sound device, such as a USB sound card, whilst being
consumed by an application, results in an infinite loop until either the
application closes the device's file descriptor, or the channel
automatically times out after hw.snd.timeout seconds. In the case of a
detach however, the timeout approach is still not ideal, since we want
all resources to be released immediatelly, without waiting for N seconds
until we can use the bus again.

The timeout mechanism works by calling chn_sleep() in chn_read() and
chn_write() (see pcm/channel.c) in order to send the thread to sleep,
using cv_timedwait_sig(). Since chn_sleep() sets the CHN_F_SLEEPING flag
while waiting for cv_timedwait_sig() to return, we can test this flag in
pcm_unregister() (called during detach) and wakeup the sleeping
thread(s) to immediately kill the channel(s) being consumed.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 months
PR:		194727, 278055, 202275, 220949, 272286
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D43545
2024-03-31 22:13:43 +08:00
Christos Margiolis dc831e93ba sound: Get rid of snd_clone and use DEVFS_CDEVPRIV(9)
Currently the snd_clone framework creates device nodes on-demand for
every channel, through the dsp_clone() callback, and is responsible for
routing audio to the appropriate channel(s). This patch gets rid of the
whole snd_clone framework (including any related sysctls) and instead
uses DEVFS_CDEVPRIV(9) to handle device opening, channel allocation and
audio routing. This results in a significant reduction in code size as
well as complexity.

Behavior that is preserved:

- hw.snd.basename_clone.
- Exclusive access of an audio device (i.e VCHANs disabled).
- Multiple processes can read from/write to the device.
- A device can only be opened as many times as the maximum allowed
  channel number (see SND_MAXHWCHAN in pcm/sound.h).
- OSSv4 compatibility aliases are preserved.

Behavior changes:

Only one /dev/dspX device node is created (on attach) for each audio
device, as opposed to the current /dev/dspX.Y devices created by
snd_clone. According to the sound(4) man page, devices are not meant to
be opened through /dev/dspX.Y anyway, so it is best if we do not create
device nodes for them in the first place. As a result of this, modify
dsp_oss_audioinfo() to print /dev/dspX in the "ai->devnode", instead of
/dev/dspX.Y.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 months
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D44411
2024-03-31 13:20:17 +08:00
Martin Matuska 783d3ff6d7 zfs: merge openzfs/zfs@39be46f43
Notable upstream pull request merges:
 #15509 b1e46f869 Add ashift validation when adding devices to a pool
 #15927 45e23abed Update resume token at object receive
 #15941 bf8f72359 BRT: Skip duplicate BRT prefetches
 #15950 8cd8ccca5 BRT: Skip getting length in brt_entry_lookup()
 #15951 80cc51629 ZAP: Massively switch to _by_dnode() interfaces
 #15954 2c01cae8b BRT: Change brt_pending_tree sorting order
 #15955 4616b96a6 BRT: Relax brt_pending_apply() locking
 #15959 5c4a4f82c zio: update ZIO type x stage documentation
 #15962 493fcce9b Provide macros for setting and getting blkptr birth times
 #15963 90ff73235 freebsd: fix missing headers in distribution tarball
 #15967 f68bde723 BRT: Make BRT block sizes configurable
 #15976 c28f94f32 ZAP: Some cleanups/micro-optimizations
 #15995 cfb96c772 vdev_disk: clean up spa/bdev mode conversion
 #16006 c0aab8b8f zvols: prevent overflow of minor device numbers
 #16007 a89d209bb BRT: Fix holes cloning
 #16008 c9d8f6c59 Fix option string, adding -e and fixing order

Obtained from:	OpenZFS
OpenZFS commit:	39be46f43f
2024-03-30 23:54:24 +01:00
Alan Cox e0388a906c arm64: enable superpage mappings by pmap_mapdev{,_attr}()
In order for pmap_kenter{,_device}() to create superpage mappings,
either 64 KB or 2 MB, pmap_mapdev{,_attr}() must request appropriately
aligned virtual addresses.

Reviewed by:	markj
Tested by:	gallatin
Differential Revision:	https://reviews.freebsd.org/D42737
2024-03-30 15:41:30 -05:00
Eliot Solomon fd6cb031f5 arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1]
The ATTR_CONTIGUOUS bit within an L3 page table entry designates that
L3 page as being part of an aligned, physically contiguous collection
of L3 pages.  For example, 16 aligned, physically contiguous 4 KB pages
can form a 64 KB superpage, occupying a single TLB entry.  While this
change only creates ATTR_CONTIGUOUS mappings in a few places,
specifically, the direct map and pmap_kenter{,_device}(), it adds all
of the necessary code for handling them once they exist, including
demotion, protection, and removal.  Consequently, new ATTR_CONTIGUOUS
usage can be added (and tested) incrementally.

Modify the implementation of sysctl vm.pmap.kernel_maps so that it
correctly reports the number of ATTR_CONTIGUOUS mappings on machines
configured to use a 16 KB base page size, where an ATTR_CONTIGUOUS
mapping consists of 128 base pages.

Additionally, this change adds support for creating L2 superpage
mappings to pmap_kenter{,_device}().

Reviewed by:	markj
Tested by:	gallatin
Differential Revision:	https://reviews.freebsd.org/D42737
2024-03-30 13:37:17 -05:00
Konstantin Belousov 9241ebc796 thread_single(9): decline external requests for traced or debugger-stopped procs
Debugger has the powers to cause unbound delay in single-threading,
which then blocks the threaded taskqueue.  The reproducer is
`truss -f timeout 2 sleep 10`.

Reported by:	mjg
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44523
2024-03-30 16:43:52 +02:00
Emmanuel Vadot 0cade55660 pkgbase: Remove FreeBSD-ipfilter package
Put the periodic script for ipfilter in the FreeBSD-ipf package with
all the utilities.

PR:	278042
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-03-30 09:39:52 +01:00
Bjoern A. Zeeb 298b8f1cf0 dts: Fix arm dts path for marvell too
Linux 6.5 moved to a vendor-based subdirectory for arm DTS, change
our Makefiles accordingly.

This makes universe also compile arm.armv7 ARMADA38X sucessfully.
2024-03-30 02:31:32 +00:00
Robert Evans 39be46f43f
Linux 5.18+ compat: Detect filemap_range_has_page
In v5.18 `filemap_range_has_page` moved to `pagemap.h`

`pagemap.h` has been around since 3.10 so just include both

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Robert Evans <evansr@google.com>
Closes #16034
2024-03-29 17:11:52 -07:00
Pierre-Luc Drouin 44847114bd vf_i2c: update I2C controller logic
Update the I2C controller logic to be more consistent with the
newer version of the controller reference manual.
This makes it work better on modern LS/LX platforms and avoids
unnecessary delays.  Also fixes a lock leak.

MFC after:	7 days
Tested by:	bz (LS1088a FDT), Pierre-Luc Drouin (Honeycomb, ACPI)
Differential Revision:	https://reviews.freebsd.org/D44021
2024-03-29 23:05:03 +00:00
Pierre-Luc Drouin 5ca8e32633 vf_i2c: split up and add ACPI attachments in addition to FDT
Move the code from the arm specific to the iicbus controller directory.
Split up between general logic and bus attachment code.
Add support for ACPI attachment in addition to FDT.

MFC after:	7 days
Tested by:	bz (LS1088a FDT), Pierre-Luc Drouin (Honeycomb, ACPI)
Based on:	D24917 by Val Packett (initial early version)
Differential Revision:	https://reviews.freebsd.org/D44020
2024-03-29 23:04:51 +00:00
Robert Evans 2553f94c42
Fix buffer underflow if sysfs file is empty
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Jason Lee <jasonlee@lanl.gov>
Signed-off-by: Robert Evans <evansr@google.com>
Closes #16028
Closes #16035
2024-03-29 14:59:23 -07:00
Rob N cfb96c772b
vdev_disk: clean up spa/bdev mode conversion
43e8f6e37 introduced a subtle API misuse, in that it passed the output
from vdev_bdev_mode() back into itself. Fortunately, the
SPA_MODE_(READ|WRITE) bit values exactly map to the FMODE_(READ|WRITE) &
BLK_OPEN_(READ|WRITE) bit values, so it didn't result in a bug, but it
was hard to read and understand, so I cleaned it up.

In doing so, I noticed that the only call to vdev_bdev_mode() without
the "exclusive" flag set was in that misuse, and actually, we never do a
non-exclusive blkdev_get_by_path(). So I've just made exclusive be
always-on.


Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #15995
2024-03-29 14:51:33 -07:00
Fabian-Gruenbichler c0aab8b8f9
zvols: prevent overflow of minor device numbers
currently, the linux kernel allows 2^20 minor devices per major device
number.  ZFS reserves blocks of 2^4 minors per zvol: 1 for the zvol
itself, the other 15 for the first partitions of that zvol. as a result,
only 2^16 such blocks are available for use.

there are no checks in place to avoid overflowing into the major device
number when more than 2^16 zvols are allocated (with volmode=dev or
default). instead of ignoring this limit, which comes with all sorts of
weird knock-on effects, detect this situation and simply fail allocating
the zvol block device early on.

without this safeguard, the kernel will reject the attempt to create an
already existing block device, but ZFS doesn't handle this error and
gets confused about which zvol occupies which minor slot, potentially
resulting in kernel NULL derefs and other issues later on.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Closes #16006
2024-03-29 14:37:40 -07:00
Gleb Smirnoff b977dd1ea5 linux: make linux_netlink_p->msg_from_linux be able to fail
The KPI for this function was misleading.  From the NetLink perspective it
looked like a function that: a) allocates new hdr, b) can fail.  Neither
was true.  Let the function return a error code instead of returning the
same hdr it was passed to.  In case if future Linux NetLink compatibility
support calls for reallocating header, pass hdr as pointer to pointer.

With KPI that returns a error, propagate domain conversion errors all the
way up to NetLink module.  This fixes panic when unknown domain is
converted to 0xff and this invalid value is passed into NetLink
processing.

PR:			274536
Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D44392
2024-03-29 13:35:51 -07:00
Gleb Smirnoff 9d4a08d162 linux: use sa_family_t for address family conversions
Express "conversion failed" with maximum possible value.  This allows to
reduce number of size/signedness conversion in the code that utilizes the
functions.

PR:			274536
Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D44375
2024-03-29 13:35:37 -07:00
Gleb Smirnoff fa93ba4097 if_tuntap: simplify storage of per-vnet cloners
There is no need for a separate structure neither for a linked list.
Provide each VNET with an array of pointers to if_clone that has the same
size as the driver list.

Reviewed by:		zlei, kevans, kp
Differential Revision:	https://reviews.freebsd.org/D44307
2024-03-29 12:35:41 -07:00
Bojan Novković bdc903460b kern_ctf.c: Don't print out warning messages unconditionally
The kernel CTF loading routines print various warnings when attempting
to load CTF data from an ELF file. After the changes in c21bc6f3c2
those warnings are unnecessarily printed for each kernel module
that was compiled without CTF data.

The kernel linker already uses the bootverbose flag to conditionally
print CTF loading errors. This patch alters kern_ctf.c
routines to do the same.

Reported by:	Alexander@leidinger.net
Approved by:	markj (mentor)
Fixes: c21bc6f3c2 ("ddb: Add CTF-based pretty printing")
2024-03-29 20:32:18 +01:00
Mark Johnston 2ae32f1f8f build: Do not pass -fno-sanitize-memory-param-retval to subr_coverage.c
In the absence of -fsanitize=kernel-memory, the presence of this flag
results in a -Wunused-command-line-argument warning.

MFC after:	1 week
2024-03-29 15:26:07 -04:00
Gleb Smirnoff 1a8d176432 inpcb: fully retire inp_ppcb pointer
Before a protocol specific control block started to embed inpcb in self
(see 0aa120d52f, e68b379244, 483fe96511) this pointer used to point
at it.

Retain kf_sock_inpcb field in the struct kinfo_file in <sys/user.h>.  The
exp-run detected a minimal use of the field in ports:
  * sysutils/lsof - patched upstream
  * net-mgmt/netdata  - patch accepted upstream
  * emulators/qemu-user-static - upstream master branch seems not using
    the field anymore
We can keep the field around for some time, but eventually it may be
reused for something else.

PR:			277659 (exp-run)
Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D44491
2024-03-29 12:18:32 -07:00
George Wilson b1e46f869e
Add ashift validation when adding devices to a pool
Currently, zpool add allows users to add top-level vdevs that have
different ashifts but doing so prevents users from being able to
perform a top-level vdev removal. Often times consumers may not realize
that they have mismatched ashifts until the top-level removal fails.

This feature adds ashift validation to the zpool add command and will
fail the operation if the sector size of the specified vdev does not
match the existing pool. This behavior can be disabled by using the -f
flag. In addition, new flags have been added to provide fine-grained
control to disable specific checks. These flags
are:

--allow-in-use
--allow-ashift-mismatch
--allow-replicaton-mismatch

The force flag will disable all of these checks.

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Mark Maybee <mmaybee@delphix.com>
Signed-off-by: George Wilson <gwilson@delphix.com>
Closes #15509
2024-03-29 13:15:56 -06:00
Bjoern A. Zeeb de2a4e80d7 LinuxKPI: remove dummy header files with implementation
All three files now have an implementation so we no longer need the
"dummy" versions.

Sponsored by:	The FreeBSD Foundation
2024-03-29 19:10:02 +00:00
Christos Margiolis d46a6a77e8 pcm.4: Showcase default device change using mixer(8)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44556
2024-03-29 23:59:55 +08:00
Christos Margiolis b5e55dbf35 sound: Remove unused SND_DEV_LAST and SND_DEV_MAX constants
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44554
2024-03-29 23:32:38 +08:00
Christos Margiolis c136e6180e sound: Fix SND_DIAGNOSTIC ifdef comment
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44555
2024-03-29 23:32:13 +08:00
Christos Margiolis 6d1cee1640 sound: Get rid of pcm/sndstat.h and turn macros into regular code
There is no reason to have macros for this. Putting the code in
sndstat_prepare_pcm() directly makes it easier to work with it.

No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44545
2024-03-29 23:29:43 +08:00
Christos Margiolis fba54d0179 sound: Drain buffer selinfo in sndbuf_free()
Prevent a use-after-free in kern_poll() by making sure the buffer's
selinfo is drained. This is required for a subsequent patch that
implements asynchronous audio device detach.

Reported by:	KASAN
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44544
2024-03-29 23:29:23 +08:00
Colin Percival 6baddb6b11 release.sh: Don't install git if already present
Prior to this commit, we install git from ports if there is a ports
tree available and git is not installed, and we install git from pkg
otherwise -- including the case where git is already installed.

Rework the logic to not (re)install git at all if it is already
installed.

MFC after:	3 days
2024-03-29 00:12:52 -07:00
Gleb Smirnoff 3f2b960775 vtnet: set VNET context in RX handler
The context is required for NIC-level pfil(9) filtering.
2024-03-28 14:12:39 -07:00
Gleb Smirnoff 1bfe195143 pfilctl: fix 'pfilctl hooks' when nothing is connected
The 'hooks' command actually worked accidentially until now.  It used
PFILIOC_LISTHEADS to determine current number of hooks.  This worked when
at least one head had a hook connected to it.
2024-03-28 14:10:15 -07:00
Bojan Novković 722b8e3cb6 Fix style nits in kern_linker.c
Reported by:	jrtc27
Fixes:	c21bc6f3c2 ("ddb: Add CTF-based pretty printing")
Approved by:	markj (mentor)
2024-03-28 20:36:30 +01:00
Bojan Novković 637e67e032 ddb: Drop obsolete -FreeBSD identifier from license
Reported by:	jrtc27
Fixes:	c21bc6f3c2 ("ddb: Add CTF-based pretty printing")
Approved by:	markj (mentor)
2024-03-28 20:32:52 +01:00
Stephen J. Kiernan 2aee804c9e kerneldump: Add flag to indicate kernel core was successfully dumped
This allows for shutdown_final EVENTHANDLERs to know that a core dump
successfully occurred. Embedded systems may want to record this fact
or act on it.

Obtained from:	Juniper Networks, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D44542
2024-03-28 14:11:16 -04:00
Stephen J. Kiernan fe429e6794 stand/efi: Changes to efichar to allow it to be used in the kernel
Replace malloc/free with EFICHAR_MALLOC and EFICHAR_FREEE macros.

Obtained from:	Juniper Networks, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D44541
2024-03-28 14:09:37 -04:00
Kristof Provost a983cea4e9 pf: fix reply-to after rdr and dummynet
If we redirect a packet to localhost and it gets dummynet'd it may be
re-injected later (e.g. when delayed) which means it will be passed
through ip_input() again. ip_input() will then reject the packet because
it's directed to the loopback address, but did not arrive on a loopback
interface.

Fix this by having pf set the rcvif to V_iflo if we redirect to
loopback.

See also:	https://redmine.pfsense.org/issues/15363
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-03-28 17:06:01 +01:00
Dag-Erling Smørgrav 5aaef5a600 cp: Fix grammar in comment.
This reverts commit 416fdc2d71.
2024-03-28 15:09:45 +01:00