Commit 3193b72e authored by Alessandro Rubini's avatar Alessandro Rubini

snmp library: works around a client bug for wr date

The snmpwalk client has a bug in returning 64-bit values.
This redoes what we are already doing in wrsPpsi.c.  It's bad,
but mandatory at this point.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent e463d15f
......@@ -1707,8 +1707,8 @@ WR-SWITCH-MIB::wrsVersionGw2.0 = STRING: 5118070
WR-SWITCH-MIB::wrsVersionGw3.0 = STRING: 7efeb16
WR-SWITCH-MIB::wrsVersionHw1.0 = STRING: 3.30
WR-SWITCH-MIB::wrsVersionHw2.0 = STRING: LX240T
WR-SWITCH-MIB::wrsDateTAI.0 = Counter64: 6041400259542777856
WR-SWITCH-MIB::wrsDateString.0 = STRING: 2014-07-29-08:38:31
WR-SWITCH-MIB::wrsDateTAI.0 = Counter64: 1406623390
WR-SWITCH-MIB::wrsDateString.0 = STRING: 2014-07-29-08:43:10
@end smallexample
@c ==========================================================================
......
......@@ -85,6 +85,14 @@ static int date_group(netsnmp_mib_handler *handler,
wrs_d_get();
/*
* WARNING: the current snmpd is bugged: it has
* endianness problems with 64 bit, and the two
* halves are swapped. So pre-swap them here
*/
wrs_d_current_64 =
(wrs_d_current_64 << 32) | (wrs_d_current_64 >> 32);
/* "- 2" because last is 0 for all scalars, I suppose */
obj = requests->requestvb->name[
requests->requestvb->name_length - 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment