Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The ifHighSpeed value is not being fetched correctly for Solaris systems as seen in the following output
For a 10Gbps interface, we see
The expected output is 10000000000 expressed in Mbps, i.e 10000
IF-MIB::ifSpeed.2 = Gauge32: 10000
The issue occurs as we are using an integer(Gauge) type to fetch the ifspeed value and simply convert it into Mbps for the ifHighSpeed value, which will fail for speeds > INT_MAX-1.
From the net-snmp documentation at http://www.net-snmp.org/docs/mibs/interfaces.html
"An estimate of the interface's current bandwidth in bits per second. For interfaces which do not vary in bandwidth
or for those where no accurate estimation can be made, this object should contain the nominal bandwidth. If the
bandwidth of the interface is greater than the maximum value reportable by this object then this object should report its
maximum value (4,294,967,295) and ifHighSpeed must be used to report the interace's speed. For a sub-layer which has
no concept of bandwidth, this object should be zero.
"
The fix will use a uint64 type for storing the ifspeed value, and will display the ifspeed value as per the docs.
Here's the output after applying the fix