Files
moby/libnetwork/types
Sebastiaan van Stijn 59722228d7 libnetwork/types: compareIPMask: make error more readable
Both net.IP and net.IPMask implement a stringer interface; use it to print
their value. While updating also removed the naked return.

Before this patch:

    cannot compute host portion ip address because ip and mask are not compatible: (net.IP{0x20, 0x1, 0xd, 0xb8, 0x20, 0x2, 0x20, 0x1, 0xff, 0xff, 0xab, 0xcd, 0xee, 0xab, 0x0, 0xcd}, net.IPMask{0xff, 0xff, 0xff, 0x0})
    cannot compute host portion ip address because ip and mask are not compatible: (net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xad, 0x20, 0x4, 0x5}, net.IPMask{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0})
    cannot compute host portion ip address because ip and mask are not compatible: (net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xad, 0x20, 0x4, 0x5}, net.IPMask{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0})

With this patch:

    cannot compute host portion ip address because ip and mask are not compatible: (2001:db8:2002:2001:ffff:abcd:eeab:cd, ffffff00)
    cannot compute host portion ip address because ip and mask are not compatible: (173.32.4.5, 000000000000000000000000ffffff00)
    cannot compute host portion ip address because ip and mask are not compatible: (173.32.4.5, 00000000000000000000ffffffffff00)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-22 12:45:22 +01:00
..