-
Notifications
You must be signed in to change notification settings - Fork 117
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
[rfc2737]: Handle unicode error when parsing transceiver #235
Conversation
data. Signed-off-by: Suvarna Meenakshi <[email protected]>
Add a unit test? In reply to: 929771195 |
Could you double check the impact of similar issue on later branches including master? |
Signed-off-by: Suvarna Meenakshi <[email protected]>
Signed-off-by: Suvarna Meenakshi <[email protected]>
Added a unit test with mock junk string in DB |
Signed-off-by: Suvarna Meenakshi <[email protected]>
It has been hard to reproduce the exact scenario of having corrupted string in the STATE_DB and SNMP trying to decode it.
|
tests/mock_tables/state_db.json
Outdated
@@ -24,6 +24,13 @@ | |||
"manufacturer": "VENDOR_NAME", | |||
"model": "MODEL_NAME" | |||
}, | |||
"TRANSCEIVER_INFO|Ethernet4": { | |||
"type": "QSFP+", | |||
"hardware_rev": "\xff\xff", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised a github issue , where the bad string can cause agentx crash in 2021/master branch.
#239.
This issue will be seen on branches >= 2020x .
This issue will be seen in 20911 or 201811 branches. |
Various options to fix this:
|
Requires change in unit-test.
tested. Signed-off-by: Suvarna Meenakshi <[email protected]>
data.
Signed-off-by: Suvarna Meenakshi [email protected]
- What I did
If there is an issue in transceiver data and some junk characters are present in transceiver data, then SNMP does not parse this information and transceiver MIB cannot be queried.
Error seen in such scenario:
To avoid seeing this error message and to retrieve the transceiver information that is available in SNMP output, this fix is made.
- How I did it
Handle unicode error to handle parsing error seen in snmp_ax_impl.
- How to verify it
In the device where the above error was seen, fix was made and tested.
- Description for the changelog