diff --git a/staticlibs/device/com/android/net/module/util/netlink/NduseroptMessage.java b/staticlibs/device/com/android/net/module/util/netlink/NduseroptMessage.java index 2e9a99bb06..586f19d82e 100644 --- a/staticlibs/device/com/android/net/module/util/netlink/NduseroptMessage.java +++ b/staticlibs/device/com/android/net/module/util/netlink/NduseroptMessage.java @@ -156,8 +156,9 @@ public class NduseroptMessage extends NetlinkMessage { @Override public String toString() { - return String.format("Nduseroptmsg(%d, %d, %d, %d, %d, %s)", + return String.format("Nduseroptmsg(family:%d, opts_len:%d, ifindex:%d, icmp_type:%d, " + + "icmp_code:%d, srcaddr: %s, %s)", family, opts_len, ifindex, Byte.toUnsignedInt(icmp_type), - Byte.toUnsignedInt(icmp_code), srcaddr.getHostAddress()); + Byte.toUnsignedInt(icmp_code), srcaddr.getHostAddress(), option); } } diff --git a/staticlibs/tests/unit/src/com/android/net/module/util/netlink/NduseroptMessageTest.java b/staticlibs/tests/unit/src/com/android/net/module/util/netlink/NduseroptMessageTest.java index 4fc5ec2e2b..d1df3a62ba 100644 --- a/staticlibs/tests/unit/src/com/android/net/module/util/netlink/NduseroptMessageTest.java +++ b/staticlibs/tests/unit/src/com/android/net/module/util/netlink/NduseroptMessageTest.java @@ -252,8 +252,10 @@ public class NduseroptMessageTest { public void testToString() { NduseroptMessage msg = parseNduseroptMessage(toBuffer(MSG_PREF64)); assertNotNull(msg); - assertEquals("Nduseroptmsg(10, 16, 1431655765, 134, 0, fe80:2:3:4:5:6:7:8%1431655765)", - msg.toString()); + final String expected = "Nduseroptmsg(family:10, opts_len:16, ifindex:1431655765, " + + "icmp_type:134, icmp_code:0, srcaddr: fe80:2:3:4:5:6:7:8%1431655765, " + + "NdOptPref64(2001:db8:3:4:5:6::/96, 10064))"; + assertEquals(expected, msg.toString()); } // Convenience method to parse a NduseroptMessage that's not part of a netlink message.