On Thu, Feb 16, 2006 at 12:31:18PM +0000, Jasper Wallace wrote:
In unpack_wirelessClient it does:
{ guint8 idx = 13; guint16 i, len;
if (vb->oid_len < idx) return -1; len = vb->oid[idx++]; if (len > 115) return -1; if (vb->oid_len < idx + len) return -1; for (i = 0; i < len; i++) { wirelessClient->wirelessPhysAddress[i] = vb->oid[idx++]; } wirelessClient->_wirelessPhysAddressLength = len; if (vb->oid_len > idx) return -1; return 0;
}
the problem is "len = vb->oid[idx++];", the 1st byte of the mac address is not it's length! (and it's 0x00 on most machines here). The responces you get from the box are like:
.1.3.6.1.4.1.63.501.3.2.2.1.4.0.17.36.45.42.196=515621
where 0.17.36.45.42.196 == 00:11:24:2d:2a:c4
the "if (vb->oid_len < idx + len)" test would then fail.
But that just means that the box is broken wrt. the MIB. The MIB says
INDEX { wirelessPhysAddress } INDEX { dhcpPhysAddress }
and both of them are of type PhysAddress, which is a variable length octet string. RFC 2578 section 7.7 explains how variable-length strings are encoded and that there is a leading length octet. If you replace PhysAddress with MacAddress, you get a fixed length encoding and then the length octet goes away.
If you are a proper Apple customer, you might want to report this bug so that they can simply fix their broken MIB module.
/js