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

(dc) DatagramChannel multicast implementation should use interface index rather than address where possible


    • Type: Enhancement
    • Status: In Progress
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 15
    • Component/s: core-libs
    • Labels:


      The underlying/internal Net implementation used by the DatagramChannelImpl needs a number of improvements and cleanups:

      1.On Windows, joining an IPv4 multicast group uses IP_ADD_MEMBERSHIP where the network interface is identified by an IPv4 address. It would be more reliable to use MCAST_JOIN_GROUP so that the interface is specified by index. An alternative is to set the imr_interface field in the ip_mreq and ip_mreq_source structures to the interface index (if the first octet is 0 then Windows treats it as an interface index). MCAST_JOIN_GROUP seems a better choice, esp. as Windows XP is no longer supported.

      2. On Linux and Solaris, we can also move to MCAST_JOIN_GROUP so that the network interface is identified by its index rather than an IPv4 address. The alternative on Linux is to use IP_ADD_MEMBERSHIP with the ip_mreqn structure rather than legacy ip_mreq structure.
      3. On Windows, the optval value types should be checked to ensure that they match the Windows documentation. There are a couple of places where a struct in_addr is used but the documentation says the type is a DWORD.




            • Assignee:
              alanb Alan Bateman
              alanb Alan Bateman
            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: