[snmp] TrapPduv1.getIpAddress() returns negative values

Birgit Arkesteijn birgit at westhawk.co.uk
Mon Nov 6 13:07:57 GMT 2006


Hi Jordi,

I've never seen this behaviour before.

I just run the snmpv1 examples ReceiveTrap (on one machine) & SendTrap
(on the other machine) against each other, using jdk 1.4 on Linux,
successfully.

run 1:
trap id 1, v SNMPv1 from host 192.67.4.53, sent from port 33504

run 2:
raw pdu v SNMPv1 from host 192.67.4.53, sent from port 33504


Which platform do you run the stack?
Which jdk do you use?

Which IP address are you talking about?
- the TrapPduv1.getIpAddress() 
- TrapEvent.getPdu().getContext().getHost()
- something else
What do you use to print the IP address?

Cheers, Birgit


On Sun, Nov 05, 2006 at 07:14:28PM +0100, Jordi Vea wrote:
> Hello,
> 
> I'm quite new using the stack (v 5.1), but I have detected a strange 
> behaviour with the TrapPduv1.
> I'm receiving traps from a SNMP agent at the IP 192.168.10.60, but 
> the stack gets the IP as -64.-88.10.60. ( -64=192-256, -88=168-256 )
> I sniffed the SNMP PDU using Ethereal, and the Agent Address was ok, 
> so I think this might be a bug from the stack. It has an easy work 
> around, but has anyone detected this behaviour before?
> 
> Thanks,
> Jordi Vea

-- 
-- Birgit Arkesteijn, birgit at westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>


More information about the snmp mailing list