Page MenuHomeFreeBSD

ctld: Only check physical port linking in a single configuration context
ClosedPublic

Authored by jhb on May 19 2026, 3:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 17, 3:12 AM
Unknown Object (File)
Tue, Jun 16, 6:39 PM
Unknown Object (File)
Tue, Jun 9, 5:17 AM
Unknown Object (File)
Mon, Jun 8, 7:35 AM
Unknown Object (File)
Sun, Jun 7, 3:24 PM
Unknown Object (File)
Thu, Jun 4, 11:49 PM
Unknown Object (File)
Thu, Jun 4, 5:44 PM
Unknown Object (File)
Thu, Jun 4, 5:44 PM
Subscribers

Details

Summary

Commit 969876fcee57 moved struct pport from being per-configuration to
being a "global" object shared across multiple configurations. As a
result, the check for duplicate ports actually spanned across
configurations, such that reloading a configuration would now think
that existing physical ports were alreay linked.

The linking field in pport added in the C++-ification (commit
6acc7afa34aa) faithfully replicated this bug (albeit simpler as I had
noticed that the TAILQ links weren't used after the earlier commit).

To restore the desired behavior, remove the linking field from struct
pport entirely and use a local unordered_map in conf::add_pports which
tracks if a given pport is claimed by more than one target.

PR: 293076
Reported by: Ken J. Thomson <thomsonk@yandex.com>
Fixes: 969876fcee57 ("ctld: parse config file independently of getting kernel info")
Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.May 19 2026, 3:14 PM
jhb retitled this revision from ctld: Only check physical port linking within a single configuration context to ctld: Only check physical port linking in a single configuration context.Wed, May 27, 8:53 PM

I was able to effectively test this today using pre-existing ioctl ports.

This revision was not accepted when it landed; it landed in state Needs Review.Wed, May 27, 9:00 PM
This revision was automatically updated to reflect the committed changes.