[SNMP4J] SNMP4j Support for IPv6 Link local Address

Arun Viswanath arun.viswanath at gmail.com
Thu Mar 5 17:17:24 CET 2015


Hi All,

Does SNMP4j support IPv6 Link Local Address ?

I'm setting the PDUv1.agentAddress with IPv6 Link Local Address and this
address it converted to 0.0.0.0 after IpAddress.encode function.

@Override
    public void encodeBER(OutputStream outputStream)
            throws java.io.IOException
    {
        final byte[] address = new byte[4];
        if (inetAddress instanceof Inet6Address)
        {
            final Inet6Address v6Addr = (Inet6Address) inetAddress;
            if (v6Addr.isIPv4CompatibleAddress())
            {
                final byte[] v6Bytes = inetAddress.getAddress();
                System.arraycopy(v6Bytes, v6Bytes.length - 5, address, 0,
4);
            }
        }
        else
        {
            System.arraycopy(inetAddress.getAddress(), 0, address, 0, 4);
        }
        BER.encodeString(outputStream, BER.IPADDRESS, address);
    }

>From this code it seems like it support only IPv4 mapped IPv6 address.

My management application[manager] is expecting proper IPv6 address in
PDUv1.agent address in v1 Trap.


Is there is any way we can attain this ?

Thanks In Advance,
Arun V



More information about the SNMP4J mailing list