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

(dc) DatagramChannel.setOption(IP_MULTICAST_IF) fails if IPv6 disabled on interface (win)

    XMLWordPrintable

Details

    • Bug
    • Status: In Progress
    • P4
    • Resolution: Unresolved
    • 15, 18
    • 21
    • core-libs
    • 15

    Description

      This issue came up on SO here:
      https://stackoverflow.com/questions/68769776/socketexception-when-calling-setnetworkinterface-on-a-multicastsocket-with-an-ip

      The environment is Windows with IPv6 enabled but disabled on a specific network interface, say "eth1".

      A DatagramChannel (or DatagramSocket or MulticastSocket) to an IPv6 socket is created. The setOption method is invoked to set the outgoing interface for multicast datagrams to be "eth1". The expectation is that it should succeed because it has IPv4 enabled but it fails because IPv6 is disabled.

      The issue can be worked by running with IPv6 disabled (-Djava.net.preferIPv4Stack=true). For DatagramChannel, the issue can be worked around by specifying the INET protocol family when creating the DatagramChannel. For MulticastSocket, the issue can be worked around in JDK 15 to 17 by running with the old DatagramSocketImpl (-Djdk.net.usePlainDatagramSocketImpl=true).

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: