Skip to content

Commit

Permalink
Use corrected length for TLV data
Browse files Browse the repository at this point in the history
  • Loading branch information
qistoph committed Feb 19, 2012
1 parent 0e26c22 commit f1915db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CdpSniffino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ void loop() {
rbufIndex+=2;
unsigned int cdpFieldLength = (rbuf[rbufIndex] << 8) | rbuf[rbufIndex+1];
rbufIndex+=2;
cdpFieldLength -= 4;

switch(cdpFieldType) {
case 0x0001:
Expand Down Expand Up @@ -130,7 +131,7 @@ void loop() {
//todo: other types
}

rbufIndex += cdpFieldLength - 4;
rbufIndex += cdpFieldLength;
}

Serial.println();
Expand Down

0 comments on commit f1915db

Please sign in to comment.