media: a copper SFP mates an RJ45 peer, at the module's rate #1594
Closed
jaylouisw
wants to merge 1 commit from
fix/1116-0305 into main
pull from: fix/1116-0305
merge into: jaylouisw:main
jaylouisw:main
jaylouisw:rev/1121-1812
jaylouisw:catalogue/1121-1822
jaylouisw:docs/1121-1817
jaylouisw:catalogue/1121-1752
jaylouisw:docs/1121-1747
jaylouisw:rev/1121-1742
jaylouisw:catalogue/1121-1722
jaylouisw:rev/1121-1712
jaylouisw:docs/1121-1717
jaylouisw:catalogue/1121-1652
jaylouisw:rev/1121-1642
jaylouisw:docs/1121-1647
jaylouisw:ci/1121-1646
jaylouisw:ci/1121-1427
jaylouisw:rev/1121-1412
jaylouisw:catalogue/1121-1422
jaylouisw:docs/1121-1417
jaylouisw:catalogue/1121-1352
jaylouisw:rev/1121-1342
jaylouisw:docs/1121-1347
jaylouisw:rev/1121-1212
jaylouisw:catalogue/1121-1222
jaylouisw:docs/1121-1217
jaylouisw:ci/1121-1027
jaylouisw:catalogue/1121-1022
jaylouisw:rev/1121-1013
jaylouisw:docs/1121-1017
jaylouisw:catalogue/1121-0852
jaylouisw:rev/1121-0842
jaylouisw:docs/1121-0847
jaylouisw:ci/1121-0827
jaylouisw:catalogue/1121-0822
jaylouisw:rev/1121-0812
jaylouisw:catalogue/1121-0752
jaylouisw:rev/1121-0742
jaylouisw:docs/1121-0747
jaylouisw:catalogue/1121-0722
jaylouisw:docs/1121-0717
jaylouisw:rev/1121-0712
jaylouisw:rev/1121-0642
jaylouisw:plan/1121-0637
jaylouisw:ci/1121-0627
jaylouisw:catalogue/1121-0622
jaylouisw:rev/1121-0612
jaylouisw:docs/1121-0617
jaylouisw:plan/1120-0337
jaylouisw:docs/1120-0347
jaylouisw:rev/1119-1942
jaylouisw:rev/1119-1912
jaylouisw:catalogue/1119-1752
jaylouisw:docs/1119-1347
jaylouisw:catalogue/1119-1352
jaylouisw:fix/1119-1232
jaylouisw:fix/1119-0602
jaylouisw:catalogue/1119-0452
jaylouisw:catalogue/1119-0422
jaylouisw:docs/1119-0417
jaylouisw:fix/1119-0202
jaylouisw:catalogue/1119-0222
jaylouisw:rev/1119-0042
jaylouisw:catalogue/1118-2252
jaylouisw:docs/1118-2047
jaylouisw:catalogue/1118-2152
jaylouisw:fix/1118-2037
jaylouisw:ci/1118-2027
jaylouisw:docs/1118-1416
jaylouisw:fix/1118-1006
jaylouisw:catalogue/1118-0326
jaylouisw:catalogue/1117-2326
jaylouisw:catalogue/1117-0025
jaylouisw:catalogue/1116-1730
jaylouisw:fix/1523-speed-downgrade-one-end
jaylouisw:fix/enable-required-and-empty-pipe-help
jaylouisw:land-all-v5
jaylouisw:land-all-v4
jaylouisw:land-all-v3
jaylouisw:land-all-v2
jaylouisw:land-all
jaylouisw:fix/board-id
jaylouisw:fix/stated-range
jaylouisw:fix/no-form-names-v2
jaylouisw:fix/voice-vlan
jaylouisw:devices/catalogue-batch
jaylouisw:devices/powerline-moca
jaylouisw:devices/firewalls-enterprise
jaylouisw:devices/pon-splitters
jaylouisw:devices/nvr-and-taps
jaylouisw:devices/four-nvr-models
jaylouisw:fix/contributing-exemption
jaylouisw:fix/stale-github-urls
jaylouisw:ci/cancel-superseded-runs
jaylouisw:gh/1438
jaylouisw:device/uisp-console-lbe-xr
jaylouisw:gh/1442
jaylouisw:docs/readme-current-counts
jaylouisw:feat/device-ubiquiti-wave-fiber-onu
jaylouisw:fix/address-ownership
jaylouisw:feat/vrrp-in-path
jaylouisw:fix/merge-research-duplicate
jaylouisw:docs/hybrid-patch-current
jaylouisw:fix/audit-port-template
jaylouisw:fix/2930f-jl256a-uplinks
jaylouisw:feat/dhcp-in-path
jaylouisw:feat/hackgpon-ubiquiti-uisp-fiber-xgs
jaylouisw:feat/hackgpon-adtran-sdx-621
jaylouisw:tool/issue-duplicate-sweep
jaylouisw:feat/device-mikrotik-rb433ah
jaylouisw:feat/hackgpon-ma5671a
jaylouisw:issues/categories-and-labels
jaylouisw:ci/run-every-suite-locally
jaylouisw:chore/http-smoke
No reviewers
Labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1594
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/1116-0305"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1514
connect()refused an SFP+ cage cabled to an RJ45 port even when told the cage held1000base-t-sfp, and named no way to build it:The media table and the mating rule disagreed:
CAGE_MEDIA['sfp+']offers the copper module,CAGE_MATEsays an SFP+ cage and an RJ45 port never join. Both are true of different things - the cages do not mate, the module does. A 1000BASE-T SFP is an SFP-family part whose far side is an RJ45 socket, so a 10G cage with one in it cables to a 1G copper appliance. The only way to draw it wasforce: true, which records a cable the validator calls impossible.What changed
MEDIAentries may statefarEnd, the cage a module presents to its peer. Only1000base-t-sfpdoes; a DAC ends in another cage and an optic in a ferrule, so neither bridges.moduleBridgedMedia()answers what a port offers through a fitted module;commonMedia()andcanMate()consult it only where the cages do not mate on their own, so no pair that mated before changes verdict.E_NO_COMMON_SPEED, saying the module is a single-rate part.Tests
New
test/copper-sfp-mating.test.js(34 assertions): the mating both ways, the link named after the module and running at 1G,validateLink/connect()with and without a chosen medium, the refusals for a cage of optics, a DAC and a 100M peer, and two copper SFPs unchanged.Four existing suites asserted the old refusal and now name the module they mean:
bidi-mediacensus (a newly accepted pair may be a BX run or a copper module),cable-matrix,link-options(both copper runs offered, patch lead first),sfp28-legacyandvalidation(an optic-only cage is still refused).docs/CONNECTORS.md6.1 was a worked example of the refusal this fixes, advising "put a 1000BASE-T SFP in the uplink" - advice it then refused. It is now the accepted transcript plus the two refusals that remain, and 4.1 plusdocs/PHYSICAL_LAYER.mddescribe thefarEndrule.Full suite: 264 suites / 9585 assertions / 0 failed. Syntax check: 334 files, all OK.
Same four-way collision as #1588 — see the analysis there.
mainalready carries amediaDeclared-gated copper-SFP rule from2c39a647(PR #1602), and this branch'sfarEnd/moduleBridgedMedia()approach replaces it rather than building on it. Not rebased: choosing between the two semantics is a behaviour decision, not a conflict resolution. Needs Jay's decision.Closing as superseded: #1514 is already fixed on main by commit
2c39a647— A copper SFP in an SFP+ cage mates an RJ45 port (#1514) (#1602), merged 2026-11-16 04:40.Main now has, in
engine/media.js:copperSfpBridge(pa, pb)— when one cage isrj45/comboand the other is a module slot, it returns1000base-t-sfpinstead of nothing;commonMedia()calls it in the!cagesMate()branch, so the picker is offered the module again (the "possible media: none" gap is gone);portWithModule()+mediaDeclared— a caller-named copper module narrows the port's media, somediaIdis honoured without letting an optic into a socket with no room for it;engine/validation.jsandtest/copper-sfp-bridge.test.js(208 lines) cover the mating rule and the rate.Because main now carries a bridging rule in the same functions, every retry of #1514 conflicts in
engine/media.jsand nowhere else — that is why all three of these sat blocked. Closing rather than picking a winner: the issue is answered, and keeping three conflicting duplicates of one behaviour in the queue means nobody's CI tells them apart.The branch is left intact, not deleted. If this shape is preferred over main's, reopen or re-push it against current main as a replacement change and it can be judged on its own merits.
This branch's distinct shape: a
farEnd: 'rj45'field on the1000base-t-sfpcatalogue entry and a genericmoduleBridgedMedia()that bridges on that metadata rather than on a hardcoded copper special case. Arguably the cleaner model — a module states the cage it presents to its peer. Main instead special-cases copper viacopperSfpBridge(). That is a design preference, not a bug; it is a decision for Jay, not something this loop should switch by hand.Pull request closed