[Midnightbsd-cvs] [MidnightBSD/src] 70b035: if_vlan: Fix up if_type before attaching the inter...

Zhenlei Huang noreply at github.com
Tue Dec 16 14:19:27 EST 2025


  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/src
  Commit: 70b035a8f68d37230fa9bd5f2fc30f35f61f9ce2
      https://github.com/MidnightBSD/src/commit/70b035a8f68d37230fa9bd5f2fc30f35f61f9ce2
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2025-12-16 (Tue, 16 Dec 2025)

  Changed paths:
    M sys/net/if_vlan.c

  Log Message:
  -----------
  if_vlan: Fix up if_type before attaching the interface

ether_ifattach() does not touch if_type, so it is not mandatory to fix
the if_type after ether_ifattach(). Without this change, the event
listeners, e.g. netlink, will see wrong interface type IFT_ETHER rather
than the correct one IFT_L2VLAN. There is also a potential race that
other threads see inconsistent interface type, i.e. initially IFT_ETHER
and eventually IFT_L2VLAN.

As a nice effect, this change eliminates the memory allocation for
if_hw_addr, as vlan(4) interfaces do not support setting or retrieving
the hardware MAC address yet [1].

[1] ddae57504b79 Persistently store NIC's hardware MAC address, and add a way to retrive it

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D50914

(cherry picked from commit a19b353d354d4ef808965c53253103cb6e7e6708)
(cherry picked from commit ff54b680383bb0f212e813b74e7a3f76423d2238)


  Commit: 40aebf65535d1c5d7ffde7345162c631da1717c6
      https://github.com/MidnightBSD/src/commit/40aebf65535d1c5d7ffde7345162c631da1717c6
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2025-12-16 (Tue, 16 Dec 2025)

  Changed paths:
    M sys/netgraph/ng_iface.c

  Log Message:
  -----------
  ng_iface(4): Remove a redundant assignment of if_type

That is unnecessary since change [1], as if_alloc(IFT_PROPVIRTUAL) has
set if_type already.

[1] fc74a9f93a5f Stop embedding struct ifnet at the top of driver softcs

No functional change intended.

MFC after:	1 week

(cherry picked from commit c43d6dadf7e34a94f4d119ff6d7113ad9a9b4d38)
(cherry picked from commit 3da0853d71197610375262b8bb06cadda6c8f4dc)


  Commit: ad909e991c23534f5707063b88d71c1b5634c9ca
      https://github.com/MidnightBSD/src/commit/ad909e991c23534f5707063b88d71c1b5634c9ca
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2025-12-16 (Tue, 16 Dec 2025)

  Changed paths:
    M sys/net/if_bridge.c

  Log Message:
  -----------
  bridge: Remove a redundant assignment of if_type

ether_ifattach() no longer sets if_type to IFT_ETHER and keeps it as is
since the change [1].

[1] fc74a9f93a5f Stop embedding struct ifnet at the top of driver softcs

No functional change intended.

MFC after:	1 week

(cherry picked from commit a07604e6264b88222941fa61c6f989bad5490765)
(cherry picked from commit 193f0bde3b048559d36c3e6db5d6b2be7daeaf6f)


  Commit: 58c98b3660f6973cd59d9bd77571f8789f7893d5
      https://github.com/MidnightBSD/src/commit/58c98b3660f6973cd59d9bd77571f8789f7893d5
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2025-12-16 (Tue, 16 Dec 2025)

  Changed paths:
    M sys/netpfil/pf/if_pfsync.c

  Log Message:
  -----------
  pfsync: Remove a redundant assignment of if_type

On initializing the interface, if_alloc(IFT_PFSYNC) has set if_type
already.

No functional change intended.

MFC after:	1 week

(cherry picked from commit 48af70e7c82150942fd095a38131e454e47ad162)
(cherry picked from commit 082a6da890f3487f1465c0757784798ebe38ef84)


  Commit: cfb5b7ef5f5c83752b4648a812595cc820079bcd
      https://github.com/MidnightBSD/src/commit/cfb5b7ef5f5c83752b4648a812595cc820079bcd
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2025-12-16 (Tue, 16 Dec 2025)

  Changed paths:
    M sys/netpfil/pf/if_pfsync.c

  Log Message:
  -----------
  pfsync: Destroy buckets mutexes on clone destroying interface

So that the associated data with them will be freed.

Reviewed by:	kp
Fixes:		4fc65bcbe3fb pfsync: Performance improvement
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D51063

(cherry picked from commit 8213c07c20586a67bc7f7152bd7ff76c02cbc007)
(cherry picked from commit efbaf14c5b681c8f1a04a47c7bf8740134fff098)


  Commit: 1f103dab1e7b5ad5dd3a5adab47aba62efc71c17
      https://github.com/MidnightBSD/src/commit/1f103dab1e7b5ad5dd3a5adab47aba62efc71c17
  Author: Zhenlei Huang <zlei at FreeBSD.org>
  Date:   2025-12-16 (Tue, 16 Dec 2025)

  Changed paths:
    M sys/netpfil/pf/if_pfsync.c

  Log Message:
  -----------
  pfsync: Allocate and initialize buckets before attaching the interface

This prevents a potential race that the ioctl threads see NULL or
uninitialized buckets.

Reviewed by:	kp
Fixes:		4fc65bcbe3fb pfsync: Performance improvement
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D51064

(cherry picked from commit edc307eca9a9a9b0ce7445cff513b48f6489e5c6)
(cherry picked from commit 8cc376735c65a18c53a70c30957a5f56dd066b79)


Compare: https://github.com/MidnightBSD/src/compare/d1d948a0b6ff...1f103dab1e7b

To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/src/settings/notifications


More information about the Midnightbsd-cvs mailing list