portTemplate.start is arithmetic, so a non-numeric start invents ports #1525

Closed
opened 2026-11-15 18:01:14 +00:00 by jaylouisw · 0 comments
Owner

engine/topology.js:28 treats portTemplate.start as a number to add to, not a literal first name. start: '1/0/1' silently produced Gi1/0/10 .. Gi1/0/13 in a probe.

No spec in the catalogue currently uses a non-numeric start, which is why nothing catches it. test/template-expansion.test.js:97 shows the supported form: the chassis belongs in prefix - {prefix: 'Gi1/0/', start: 1, count: 24}.

Why it matters: the importer will generate templates from observed device names. A generated template with a slashed start would create ports with plausible-looking but wrong names, and every downstream fact would then be attached to the wrong port.

Suggested fix: refuse a non-numeric start by name, with the message naming the prefix/start split as the correct form.

`engine/topology.js:28` treats `portTemplate.start` as a number to add to, not a literal first name. `start: '1/0/1'` silently produced `Gi1/0/10` .. `Gi1/0/13` in a probe. No spec in the catalogue currently uses a non-numeric `start`, which is why nothing catches it. `test/template-expansion.test.js:97` shows the supported form: the chassis belongs in `prefix` - `{prefix: 'Gi1/0/', start: 1, count: 24}`. **Why it matters:** the importer will generate templates from observed device names. A generated template with a slashed start would create ports with plausible-looking but wrong names, and every downstream fact would then be attached to the wrong port. **Suggested fix:** refuse a non-numeric `start` by name, with the message naming the `prefix`/`start` split as the correct form.
Sign in to join this conversation.
No milestone
No project
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#1525
No description provided.