Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8160174

java.net.NetworkInterface - fixes and improvements for network interface listing

XMLWordPrintable

    • b129
    • Not verified

        The coding to list network interfaces contains several minor bugs and issues which should be addressed:

        - have an explicit implementation of enumIPv4Interfaces and enumIPv6Interfaces for the 4 main Unix types (Linux, AIX, Solaris, BSD) to make the code more readable
        - consolidate detection of subnets/network prefixes and broadcast addresses into the enumIPv*Interfaces methods to avoid redundant/unnecessary ioctl calls
        - never detect broadcast addresses for IPv6 interfaces as this does not apply for this address family
        - remove some unused variable declarations
        - enumIPv4Interfaces on Linux/AIX: add misising SIOCGIFFLAGS call and fix flags check before determining broadcast address (only return broadcast address if IFF_BROADCAST flag is set)
        - enumIPv6Interfaces on AIX: add network prefix detection
        - enumIPv6Interfaces on Linux: optimization, avoid unnecessary memcpy
        - enumIPv6Interfaces on BSD: remove ioctl call for netmask detection as the information is already contained in getifaddrs result
        - remove redundant check for ifname==NULL in getMTU

              clanger Christoph Langer
              clanger Christoph Langer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: