speed/duplex: a word after the value is refused, not dropped #2004
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!2004
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "rev/1118-1601"
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?
What was wrong
speedandduplexread the first word of the line and dropped the rest. Four orders did something a box would not, and three of them reported a different command than the one typed:speed 100 flurbishspeed auto 10speed auto- a different setting on hardwarespeed nonegotiate% Invalid rate "nonegotiate"about a real keywordno speed flurbishduplex full flurbishno duplex flurbishWhat the vendor says
Catalyst 2960-X 15.2(6)E command reference, Interface and Hardware Commands:
One rate, one mode, no optional tail - except after
auto, which takes the rates the port may advertise (the 3850 book's own example isspeed auto 10 100). The twonoforms do not match each other:no speedtakes nothing,no duplextakes the same three words as its positive form and returns the port to the default,auto. A word outside those shapes is% Invalid input detected at '^' marker., at parse time - so a serial port with no line rate still answers about the stray word.What this changes
Every refusal names the word back, says nothing was changed, and is answered before the port is consulted.
speed auto <rates>andspeed nonegotiateare refused as not modelled rather than as invalid input, which is what they are.no duplex half/no duplex fullstill reset to auto.Evidence and open questions
research/speed-duplex-grammar.md- the syntax lines, the error table, and the ten other interface commands the same sweep found still dropping a trailing word (switchport mode,switchport access vlan,channel-group … mode,ip nat inside,vrrp … ip,encapsulation dot1qand others), each of which needs its own run.duplex nonegotiateis left alone: the 15.2(6)E page does not list it and no page in hand does.Tests
test/speed-duplex-grammar.test.js- new, 46 checks; every refusal compared againstshow running-configbefore and after.test/no-command-swallows-a-word.test.js- new section 4: a good value plus a stray word, both commands, both device kinds (24 checks).node scripts/syntax-check.js: 419 files, all OK.npm test: 345 suites, 11,975 assertions, 0 failed.The vendor syntax lines close both commands after one value - `speed {10|100|1000|2500|5000|auto [rates]|nonegotiate}` and `duplex {auto|full|half}` - so `speed 100 flurbish` is a parse error on a box. This console read the first word and dropped the rest, and four orders lied in silence: the rate was forced, the duplex was set, `speed auto 10` was answered as a plain `speed auto` (a different setting on hardware), `speed nonegotiate` was called an invalid rate, and `no speed flurbish` returned the port to autonegotiation anyway. The two `no` forms do not match: `no speed` takes nothing, while `no duplex {auto|full|half}` takes the same three words and returns the port to the default. Every refusal names the word, changes nothing, and is answered before the port is consulted. research/speed-duplex-grammar.md carries the syntax lines, the vendor's `speed auto 10 100` example and the ten other commands the same sweep found still dropping a trailing word.This branch conflicts with
main, so it was not rebased:A conflict is a decision about behaviour rather than a mechanical fix, so this is left for a human. Rebasing by hand and force-pushing will let the automation pick it up again.
1b4836f95c63ab56af72ip name-serverline carries up to six addresses, in typed order #2013