Experts,

I am finding a differing behavior with SNMP set for an OID using
ASN_OCTET_STR.

U8 u8InetAddressBytes[4];
u8InetAddressBytes[0] = ((U8 *)&u32InetAddress)
[3];
u8InetAddressBytes[1] = ((U8 *)&u32InetAddress)
[2];
u8InetAddressBytes[2] = ((U8 *)&u32InetAddress)
[1];
u8InetAddressBytes[3] = ((U8 *)&u32InetAddress)
[0];

snmp_set_var_typed_value(requests->requestvb,
ASN_OCTET_STR,
(u_char *)u8InetAddressBytes
,sizeof(u8InetAddressBytes )
);

On one it returns the ip address of 10.255.33.196 correctly as,

OID: .1.3.6.1.4.1.4491.2.3.1.1.4.4.3.0
Value: 0x0A 0xFF 0x21 0xC4
Type: OctetString

On the other it returns the same ip address of 10.255.33.196 as,

OID: .1.3.6.1.4.1.4491.2.3.1.1.4.4.3.0
Value:
!
Type: OctetString

They are returned as the actual string without getting converted to
Octet String.
0x10 - carriage return
0xFF -
0x21 - !
0xC4 -

They both are resulting from the same code on two different machines.
What am I missing here? This is very puzzling. How can I fix this?

Thanks!