Page MenuHomeFreeBSD

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

Authored by jhb on Tue, May 19, 3:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 27, 9:58 AM
Unknown Object (File)
Tue, May 26, 11:52 PM
Unknown Object (File)
Tue, May 26, 5:53 AM
Unknown Object (File)
Tue, May 26, 1:36 AM
Unknown Object (File)
Mon, May 25, 8:30 AM
Unknown Object (File)
Fri, May 22, 1:20 PM
Unknown Object (File)
Thu, May 21, 11:15 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.Tue, May 19, 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.