Commit graph

10634 commits

Author SHA1 Message Date
Andrey V. Elsukov
119b20a90f ipfw: treat ipv6 address with zero mask as 'any'
Make the behaviour similar for both IPv4 and IPv6. Also add
the corresponding tests.

PR:             294733
Differential Revision:	https://reviews.freebsd.org/D56618

(cherry picked from commit 2872268c7f6d473aae9b02ebb5d2c24fc2cff9b1)
2026-06-08 15:34:14 +02:00
Boris Lytochkin
d796c02b50 ipfw: add ability to run ipfw(8) binary with 15.0+ kernel module
After D46183 the KBI was changed and this made the upgrade procedure
to 15.0+ version a bit difficult, because the old binary can not load
firewall rules when the new kernel is loaded.

This commit adds the sbin/ipfw15 binary that uses new KBI, and then
original sbin/ipfw can detect new KBI and run the new binary instead.

PR:		291562
Reviewed by:	jhb, glebius
Fixes:		4a77657cbc
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54763
2026-06-08 15:33:40 +02:00
Vyacheslav Terehov
15be895f78 ipfw: fix parsing error in nat config port_range
Also fix the corresponding tests.

PR:		263240
Differential Revision:	https://reviews.freebsd.org/D57010

(cherry picked from commit 6eba055fcf5b0bbfbebcac59f5982d13815001b0)
2026-06-02 07:25:48 +02:00
Dag-Erling Smørgrav
1ca7f34a07 dhclient: Improve server and filename validation
* Don't iterate over each string three times; once is enough.

* Reject control characters (anything below space) in addition to the
  double quote and backslash.

* If an unsafe character is encountered, discard the string instead of
  rejecting the entire lease.

* If backslashes are encountered in the file name option, convert them
  to forward slashes instead of rejecting the option.

* Tweak the warning messages a bit.  Looking through the rest of the
  code, it seems to me that notes generally end with a period while
  warnings generally don't.

Approved by:	so
Security:	FreeBSD-EN-26:11.dhclient
Fixes:		8008e4b88daf ("dhclient: Check for unexpected characters in some DHCP server options")
PR:		294886
MFC after:	1 week
Reviewed by:	brooks, markj
Differential Revision:	https://reviews.freebsd.org/D56740

(cherry picked from commit 873a195ba63575e46686cfd6ea9670a0ca340fa0)
(cherry picked from commit 2f9478ad42c442c49a7eff60227148bf2b90b48c)
2026-05-21 07:32:00 +02:00
Kristof Provost
55f031f303 pfctl: parser must not ignore error from pfctl_optimize_ruleset()
Ignoring the error may cause pfctl(8) to load inconsistent ruleset
preventing pf(4) to enforce desired policy.

Issue reported and fix suggested by berts _from_ fastmail _dot_ com

'Looks good.' @deraadt

MFC after:	1 week
Obtained from:	OpenBSD, sashan <sashan@openbsd.org>, 9fd28a8cca
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 343ace42f82a629374af4dc3a72da5f46f2c3feb)
2026-04-30 07:39:19 +02:00
Mark Johnston
a40d4f3dca dhclient: Fix reallocation of dhclient script environments
When the number of DHCP options exceeds a threshold, script_set_env()
will reallocate the environment, stored as an array of pointers.  The
calculation of the array size failed to multiply by the pointer size,
resulting in a smaller than expected buffer which admits out-of-bounds
writes.

Approved by:	so
Security:	FreeBSD-SA-26:15.dhclient
Security:	CVE-2026-42511
Reported by:	Joshua Rogers of AISLE Research Team (https://aisle.com/)
2026-04-29 22:14:56 +02:00
Mark Johnston
153f069af1 dhclient: Check for unexpected characters in some DHCP server options
Some options are written directly to the lease file, which may be parsed
by subsequent dhclient invocations.  We must make sure that a malicious
server can't control the "medium" field of a lease definition, otherwise
they can achieve RCE by injecting one into the lease file, whereupon it
will be passed to dhclient-script, which passes it through eval.

Approved by:	so
Security:	FreeBSD-SA-26:12.dhclient
Security:	CVE-2026-42511
Reported by:	Joshua Rogers of AISLE Research Team (https://aisle.com/)
2026-04-29 22:14:55 +02:00
Kristof Provost
3aa9ae8870 pfctl: always warn if a duplicate rule was detected
Approved by:	so
Security:	FreeBSD-SA-26:09.pf
Security:	CVE-2026-4748
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 66d66dd0f6f83926980fc1d68dd366c0057350c5)
(cherry picked from commit e79818ec36efafc994d8c5a912dcb94986c038c5)
2026-03-26 08:04:51 +01:00
Kristof Provost
8c02f3f9ae pfctl: allow new page character (^L) in pf.conf
PF configuration files can contains many things.

Using the new page characters (i.e. ^L, \014) to mark the beginning
of parts is useful because many editors such as emacs and vim has
facilities to jump next/previous ones.

PR:		86635
MFC after:	2 weeks
Submitted by:	MOROHOSHI Akihiko <moro@remus.dti.ne.jp>
Submitted by:	Simon Wollwage <rootnode+freebsd@wollwage.com>
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit fc353e5e61fadd6ef618948f417f96381c08239c)
2026-02-18 12:55:25 +01:00
Mark Johnston
4bc309c96f ifconfig: Exit with a non-zero status when SIOCSIFFIB fails
Previously, setting an interface FIB to some invalid value would result
in a warning being printed, but the ifconfig command would exit with
status 0, but this is wrong.

Add a little regression test.

Reviewed by:	pouria, zlei, melifaro
MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D54918

(cherry picked from commit 2ea85a622bcba92a7b58901d6a6e945df3022c4e)
2026-02-18 12:53:20 +01:00
William Carrel
7f8deebafb ifconfig.8: Mention max name length
PR:		289113
MFC after:	3 days

(cherry picked from commit 832cd05905980d0f6547bf02745b054c1f4af1eb)
2026-02-18 12:53:12 +01:00
Kristof Provost
2e4a4c096a ifconfig: fix removing IPv6 addresses
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit da50f49977)
2026-02-18 12:52:56 +01:00
Gleb Smirnoff
e334c34ef4 ifconfig: fix 'ifconfig -l link'
The rtnetlink(4) RTM_GETADDR does not list link level addresses, thus
the correct match for interfaces that have a link level address should
be based on what was returned by RTM_GETLINK.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D41586

(cherry picked from commit 6f3947be2a)
2026-02-18 12:52:47 +01:00
Gleb Smirnoff
ffbae2e48b ifconfig: fix 'ifconfig -l ether'
When matching interfaces for being Ethernet, use same trick that
the link module does - pass if_type through convert_iftype().
That restores historicaly behaviour of listing lagg(4) ports.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D41585

(cherry picked from commit 31016aa0be)
2026-02-18 12:52:38 +01:00
Gleb Smirnoff
9186bb10c1 ifconfig: fix logical error in interface matching for '-l ether'
This affects only ifconfig(8) compiled WITHOUT_NETLINK_SUPPORT, which
is not the default.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D41584
Fixes:			d1cd0344f7

(cherry picked from commit 24a81a968d)
2026-02-18 12:52:25 +01:00
Pouria Mousavizadeh Tehrani
97196b9630 ifconfig: fix gre(4) status
Set `ifr->ifr_name` to display gre options
for the interface.

Reviewed by: glebius, zlei
Approved by: glebius (mentor)
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D55099

(cherry picked from commit c2ba906fa63982d7aa799466d83716d39fe91d2b)
2026-02-18 12:52:13 +01:00
Mark Johnston
4cccd67caa ifconfig: Fix the -L flag when using netlink
By default, when ifconfig shows a v6 address derived from a
router-advertised prefix, it shows the initial preferred and valid
lifetimes.  When -L is specified, it is supposed to show the remaining
lifetimes, but this was broken in the conversion to netlink.

Fix that, and add a regression test which validates ifconfig output
before and after a short-lived address expires.

Reported by:	Franco Fichtner <franco@opnsense.org>
Reviewed by:	melifaro, allanjude, Seyed Pouria Mousavizadeh Tehrani
Fixes:		4c91a5dfe4 ("ifconfig: make interface and address listing use Netlink as transport")
MFC after:	2 weeks
Sponsored by:	OPNsense
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D54294

(cherry picked from commit df6861d755c8f72380ae7fb8df535b27eba8c0be)
2026-01-10 09:07:20 +01:00
Franco Fichtner
3c7008c651 Revert "ifconfig: bring back -L for netlink"
This reverts commit dfaffde6f9.
2026-01-10 09:06:10 +01:00
Eugene Grosbein
b8efad09a0 ipfw.8: fix documentation bug for setmark
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.

Discussed with:	Boris Lytochkin <lytboris@gmail.com> (author)

(cherry picked from commit a7b8a5d37bcb0009297962137bfb6c6570e5af12)
(cherry picked from commit 9fdf49e8a501047b61a615ab1b4b133159ad76e1)
2026-01-10 08:58:19 +01:00
Eugene Grosbein
a325b21530 MFC: ipfw.8: document how to delete nat configuration instance
(cherry picked from commit e51047118cb1d15abe8077a5b47b8063fa364ad9)
2026-01-10 08:58:08 +01:00
Mateusz Piotrowski
4d1fcc4bcc ipsec: Fix typos in references to IPsec's ESP
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

(cherry picked from commit 15afd75e67102f81c37adbf11966e48685bd7be7)
2025-12-17 07:56:47 +01:00
Franco Fichtner
dfaffde6f9 ifconfig: bring back -L for netlink 2025-12-16 18:06:44 +01:00
Ed Maste
2487dc223a ipfw: Remove more unused IP_FW_* cases
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

(cherry picked from commit 0e2e0fb955adf15a217949bc4cc337d53d2c7259)
(cherry picked from commit 6b1e5d4d20)
2025-11-20 12:32:40 -05:00
Ed Maste
39feb3a0e7 ipfw: Remove IP_DUMMYNET_GET case
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

(cherry picked from commit 28e52dea96809c7904e498759ee1f79bda929a82)
(cherry picked from commit 73c105268c)
2025-11-20 12:32:30 -05:00
Ed Maste
41d43ad19d ipfw: Correct error message
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

(cherry picked from commit 498e56142660c8dd864c878e820252358c9a15cf)
(cherry picked from commit c22437c8b5)
2025-11-20 12:32:02 -05:00
Ed Maste
f7c13f3363 ipfw: Update warning/error setsockopt references
Dummynet v3 switched to IP_DUMMYNET3 but did not update these
warnings/errors.

Fixes: cc4d3c30ea ("Bring in the most recent version of ipfw and dummynet, developed")
Sponsored by:	The FreeBSD Foundation
Differential Revision: sbin/ipfw/ipfw2.c

(cherry picked from commit 1f95a517880bae5fc0a9fe4463a8f2ec36ed734a)
(cherry picked from commit a5dd21c7dd)
2025-11-20 12:31:48 -05:00
Zhenlei Huang
839d02c9e3 ifconfig: Display the IFCAP_HWSTATS capability without netlink
This follows the commit 4cdc1f5421, which introduces the IFCAP_HWSTATS
capability.

Fixes:	4cdc1f5421 There are some high performance NICs that count statistics in hardware
MFC after:	3 days

(cherry picked from commit 595acb29a35f36a4fc08b89d3a476f16c1d108b4)
(cherry picked from commit 6bcce275a5)
2025-10-23 08:18:21 +02:00
Zhenlei Huang
9a29980d3e ifconfig: Fix the display of the IFCAP_MEXTPG capability without netlink
Historically this capability is IFCAP_NOMAP but it was renamed to
IFCAP_MEXTPG. Catch up with the change 3f43ada98c.

PR:		289545
Fixes:		3f43ada98c Catch up with 6edfd179c8: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG
MFC after:	3 days

(cherry picked from commit 5017fdb728811fd3e15d7151524378f49a49aee1)
(cherry picked from commit 5f472754ba)
2025-10-23 08:18:21 +02:00
Kristof Provost
c116bd7562 ifconfig: also fix removing IPv6 addresses without netlink
Reported by:	bdrewery
MFC after:	1 week
See also:	da50f49977
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit c8fb5a4d032b28dd97b9fa4a73f85a84d8d35fdd)
2025-10-23 08:18:21 +02:00
Gordon Tetlow
171adf2f75 Move print_bits to ifconfig.c and make available to other src files.
Reviewed by:	emaste
Event:		Kitchener-Waterloo Hackathon 202406
Differential Revision:	https://reviews.freebsd.org/D45441

(cherry picked from commit c3e9423743)
2025-10-23 08:17:30 +02:00
Dag-Erling Smørgrav
e19c4387d0 ifconfig: Enter jail as soon as possible
Some options (in particular, -g) are processed immediately upon being
parsed.  This will produce the wrong result in combination with -j since
we only attach to the jail after we're done parsing arguments.  Solve
this by attaching to the jail immediately when -j is encountered.  The
downside is that e.g. `ifconfig -j foo -j bar` would previously attach
to jail “bar”, whereas now it will attempt to attach to jail “foo”, and
if successful, attempt to attach to jail “bar” within jail “foo”.  This
may be considered a feature.

PR:		289134
MFC after:	1 week
Reviewed by:	zlei
Differential Revision:	https://reviews.freebsd.org/D52501

(cherry picked from commit 18fd1443d205aed6be22966125a4820f77571948)
2025-10-23 08:17:08 +02:00
Gordon Tetlow
f54f3b0eb0 Migrate from printb to print_bits for locally defined bit fields.
Reviewed by:	emaste
Event:		Kitchener-Waterloo Hackathon 202406
Differential Revision:	https://reviews.freebsd.org/D45441

(cherry picked from commit a68e4f7a06)
2025-10-23 08:16:04 +02:00
Michael Tuexen
878daff4e5 dhclient: improve UDP checksum handling
When sending UDP packets:
* compute the checksum in the correct order. This only has an impact
  if the length of the payload is odd.
* don't send packet with a checksum of zero, use 0xffff instead as
  required.
When receiving UDP packets:
* don't do any computations when the checksum is zero.
* compute the checksum in the correct order. This only has an impact
  if the length of the payload is odd.
* when computing the checksum, store the pseudo header checksum
* if the checksum is computed as zero, use 0xffff instead.
* also accept packets, when the checksum in the packet is the pseudo
  header checksum.
The last point fixes a problem when the DHCP client runs in a VM,
the DHCP server runs on the host serving the VM and the network
interface supports transmit checksum offloading. Since dhclient
doesn't use UDP sockets but bpf devices to read the packets, the
checksum will be incorrect and only contain the checksum of the
pseudo header.

PR:			263229
Reviewed by:		markj, Timo Völker
Tested by:		danilo
Differential Revision:	https://reviews.freebsd.org/D52394

(cherry picked from commit 187ee62c71f2be62870f26ae98de865e330121be)
2025-10-23 08:11:21 +02:00
Dag-Erling Smørgrav
fad9cb779f ipfw: Add tests for the NPTv6 rule parser
(cherry picked from commit d879f1c896)
2025-10-07 12:08:43 +02:00
Seyed Pouria Mousavizadeh Tehrani
fe13bb6f5f ipfw: Fix segfault in NPTv6 rule parser
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

(cherry picked from commit 64bc9ac8cd)
2025-10-07 12:08:43 +02:00
Lexi Winter
2e20b10703 ifconfig: Support VLAN ID in static/deladdr
Add an optional "vlan <n>" argument to the bridge static and deladdr
commands to allow addresses to be added to / removed from a particular
vlan.  No changes to if_bridge are required as the kernel API already
supports this, it just wasn't exposed in ifconfig.

Add tests for the new functionality, and improve the test for the
existing "static" command.

Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D51243

(cherry picked from commit 3650722abf)
2025-08-26 10:27:25 +02:00
Lexi Winter
9b6cdc5678 ifconfig/ifbridge.c: add get_vlan_id()
This is like get_val() but takes an ether_vlanid_t* and ensures the
value is a valid VLAN ID. This avoids redundant comparisons and
casting when parsing VLAN IDs.

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D51548

(cherry picked from commit 287a5fdcd3)
2025-08-26 10:26:29 +02:00
Lexi Winter
6ea749503a ifconfig: Support variable-argument commands
Add a new type of command, DEF_CMD_VARG, which takes an (argc, argv)
pair instead of a fixed number of arguments.  This allows commands
to do their own argument parsing and accept a variable number of
arguments.

Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D51243

(cherry picked from commit 7d4a177efc)
2025-08-26 10:26:10 +02:00
Zhenlei Huang
c7adca0552 ifconfig: Garbage collect unused parameter swabips
and the macro EN_SWABIPS.

The macro EN_SWABIPS is identical to IFF_LINK0 (also historically
IFF_LLC0) and we already have the parameter link0 to toggle IFF_LINK0.

These were inherited from 386BSD 0.1 and have never been used since
the very first FreeBSD release.

Reviewed by:	adrian, #network
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D51368

(cherry picked from commit 8632e4e73a)
2025-08-18 10:03:28 +02:00
Oleg Streejak
d32b38fd4a route: fix route -n monitor when its output is redirected
This is a small oversight in the transition to netlink; the non-netlink
implementation would explicitly flush its stdout as necessary to avoid
apparent long stalls in output when we end up fully-buffered.  Adjust
the netlink implementation to do the same.  This was noticed while
trying to triage failures in the wg-quick script.

Commit message by kevans, patch by author.

PR:		278265
Fixes:		091fec1188 ("route: switch transport protocol [...]")
Approved by:	so
Security:	FreeBSD-EN-25:14.route

(cherry picked from commit 97b61b22ed)
(cherry picked from commit dd695839efd80fe81143cd6c7a552c30df8448f6)
2025-08-08 11:49:20 +02:00
Koichiro Iwao
8900d0b6e4 ifconfig.8: remove accept_rev_ethip_ver and send_rev_ethip_ver
It is removed long ago [1] and unavailable on FreeBSD 11 and later,
but the corresponding entries in the man page were not removed
accordingly.

[1] https://cgit.freebsd.org/src/commit/?id=b1c250ff3ff6af36e95f5cf910973133c3445704

MFH after:	3 days
Reviewed by:	mhorne
Approved by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D51261

(cherry picked from commit cca6a72d7f)
2025-07-16 12:39:54 +02:00
Alexander V. Chernikov
0e089eb784 ifconfig_netlink.c: MFC: optimise non-listing case
This change produced by melifaro and the commit is concerted with him
as he is pretty busy IRL these days.

The change restores performance of /sbin/ifconfig utility
for non-listing case after it switched from rtsock to netlink(4) API
in FreeBSD 14+.

PR:		287872

(cherry picked from commit b1b17432aa)
2025-07-15 07:05:14 +02:00
Bjoern A. Zeeb
5f0c664ab0 ifconfig: 802.11: decode more information elements (IEs)
Start dealing with Element ID Extension present (IE T=255) and start
parsing elemants from the Element ID Extension set.

Namely (partially) decode HE_CAPA, HE_OPER, MU_EDCA_PARAM_SET,
and as well as SUP_OP_CLASS.

For length reasons also rename UNKNOWN_ELEMID_%d to ELEMID_%d.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D50678

(cherry picked from commit a2a15732eb)
2025-07-09 10:05:46 +02:00
Bjoern A. Zeeb
c596c24693 ifconfig: 802.11: decode RSNXE IE
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D50675

(cherry picked from commit 1313f1c2a3)
2025-07-09 10:05:46 +02:00
Lexi Winter
c8759dc5fb link_addr: be more strict about address formats
instead of accepting any character as a delimiter, only accept ':', '.'
and '-', and only permit a single delimiter in an address.

this prevents accepting bizarre addresses like:

	ifconfig epair2a link 10.1.2.200/28

... which is particularly problematic on an INET6-only system, in which
case ifconfig defaults to the 'link' family, meaning that:

	ifconfig epair2a 10.1.2.200/28

... changes the Ethernet address of the interface.

bump __FreeBSD_version so link_addr() consumers can detect the change.

Reviewed by:	kp, des
Approved by:	des (mentor)
Differential Revision:	https://reviews.freebsd.org/D49936

(cherry picked from commit a121509041)

Note-from-OPNsense: not bumping the FreeBSD version for stable/25.7
2025-07-09 10:05:44 +02:00
Bjoern A. Zeeb
4612cb03a8 ifconfig: 802.11: factor out keyix printing
The node unicast key (PTK) uses a key index of (-1) and printing
a 64k number does not look great.  Factor out printing the key
number into a buffer and use 'ucast' for the node unicast key.
Hope is that this will be useful for the future as well when we
will have more/different keys possibly.

Looks like (with -vk):
        AES-CCM 2:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 rx
        AES-CCM 3:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 rx
        AES-GCM ucast:128-bit <xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> rsc 0 tsc 0 tx+rx

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D50555

(cherry picked from commit 164bf9ffbe)
2025-07-09 10:05:44 +02:00
Bjoern A. Zeeb
b07fd7a6a6 ifconfig: 802.11: print node unicast key (PTK) if available in STA mode
Add a variable when querying the BSSID so we can later use it rather
than losing the "data" buffer.

When printing key information also query the node unicast key if in
STA mode (the key for the BSSID).  Do not error in case we fail.
This is helpful for debugging mostly; was also useful when testing
GCMP support.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D50554

(cherry picked from commit e277735ce0)
2025-07-09 10:05:44 +02:00
Bjoern A. Zeeb
e965e2f657 ifconfig: 802.11: also print IEEE80211_CIPHER_AES_GCM_128 information
While we currently do not print the STA unicast key (PTK) we will not
see this but it is for fullness and in preparations for follow-up
hanges.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D50553

(cherry picked from commit 54ad06cad1)
2025-07-09 10:05:44 +02:00
Bjoern A. Zeeb
ed8a87939c ifconfig: 802.11: fix a warning message
s/can/cannot/

Sponsored by:	The FreeBSD Foundation
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D50552

(cherry picked from commit 08471a76e3)
2025-07-09 10:05:44 +02:00
Lexi Winter
0149768ecb ifconfig: reject netmask and broadcast for inet6
We don't support setting netmask or broadcast address for INET6
addresses, and trying to do crashes ifconfig.  Handle this the
same way as af_link, by rejecting attempts to configure these
parameters.

PR:	286910
Reported by:	Hayzam Sherif <hayzam@alchemilla.io>
MFC after:	3 days
Reviewed by:	zlei, kevans, des, cy
Approved by:	kevans (mentor)
Differential Revision:	https://reviews.freebsd.org/D50413

(cherry picked from commit 59ee9260e6)

ifconfig tests: remove incorrect #!

Fixes: 59ee9260e6 ("ifconfig: reject netmask and broadcast for inet6")

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D50566

(cherry picked from commit 6ab70fbec4)
2025-07-09 10:05:43 +02:00