Commit 34bdd1b
committed
stp: fix misplaced break in Ieee8021dBpduSerializer causing serialization failure
The break statement in the BPDU_CFG case of the serialize() method was
placed immediately after the dynamic cast, before any of the BPDU fields
were written to the stream. This caused the serializer to only write the
4-byte BPDU header (protocolIdentifier, protocolVersionIdentifier,
bpduType = 32 bits) while the BpduCfg chunk declares chunkLength = B(35)
(280 bits).
When fcsMode was set to 'computed', the EthernetFcsInserter would
serialize the packet to compute the FCS and detect the mismatch:
'serialized length is incorrect: serialized=32 bit, chunk=280 bit'
The fix moves the break to after all BpduCfg fields are serialized.1 parent b7f0549 commit 34bdd1b
1 file changed
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
0 commit comments