Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle unknown LLDP PDUs gracefully #52

Merged
merged 2 commits into from
May 17, 2019
Merged

Handle unknown LLDP PDUs gracefully #52

merged 2 commits into from
May 17, 2019

Conversation

vasu-dasari
Copy link
Contributor

When an unknown TLV is received, whose type does not match any of the ones that are currently handled, even though the PDU is good, pkt_lldp crashes as such a packet is not handled. Wireshark shows that packet as unknown TLV. Doing the same here.

When an unknown TLV is received, whose type does not match any of the ones that are currently handled, even though the PDU is good, pkt_lldp crashes as such a packet is not handled. Wireshark shows that packet as unknown TLV. Doing the same here.
@shun159
Copy link
Collaborator

shun159 commented May 8, 2019

Hi @vasu-dasari !

If you don't mind, could you give me the LLDP packet?
Please let me check how it works, just in case.

@vasu-dasari
Copy link
Contributor Author

Hi @shun159

Here is the packet stream that can cause the problem. I wish there is a way of attaching pcap file :(

0000   01 80 c2 00 00 0e ca e1 f8 79 9b 82 88 cc 02 07
0010   04 72 71 fe 9b 8e 4d 04 03 02 00 02 06 02 00 78
0020   fe 0c 00 26 e1 00 00 00 72 71 fe 9b 8e 4d 18 08
0030   06 8f 10 aa 74 d7 9a 16 e6 01 01 fe 0c 00 26 e1
0040   01 00 00 00 00 15 10 f9 f4 00 00

@shun159
Copy link
Collaborator

shun159 commented May 13, 2019

Thanks @vasu-dasari!

I confirmed that how this PR works, looks very good 😄
Could you add some test code?

Added unit test to test unknown_lldp_tlv messages.
@vasu-dasari
Copy link
Contributor Author

@shun159 Added unit test to test new functionality.

@shun159
Copy link
Collaborator

shun159 commented May 17, 2019

@vasu-dasari LGTM, thank you!

@shun159 shun159 merged commit c943522 into msantos:master May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants