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

com.sun.jndi.dns.DNSDatagramSocketFactory openRandom method trigger Win Firewall

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10

      A DESCRIPTION OF THE PROBLEM :
      We have method which used getAttributes method in javax.naming.directory.InitialDirContext to resolve DNS records.
      env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
      InitialDirContext context = new InitialDirContext(env);
      Attributes attributes = context.getAttributes(hostname, new String[] {"TXT"});
      This code goes to com.sun.jndi.dns.DNSDatagramSocketFactory#open to open new datagram socket.
      This method had two ways for socket creation:
          com.sun.jndi.dns.DNSDatagramSocketFactory#openDefault
          com.sun.jndi.dns.DNSDatagramSocketFactory#openRandom
          For the first few requests, the open method uses openDefault and don't trigger firewall alerts but on the fourth call (in my case) for some reason openDefault returns a not suitable port and the method switch to openRandom for socket creation. openRandom uses s.bind(new InetSocketAddress(port)) and this call trigger firewall alert.
      It seems for me that it is bug that you create a socket address where the IP address is the wildcard address 0.0.0.0



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Windows firewall is not triggered by calling openRandom method
      ACTUAL -
      Windows firewall is triggered by calling openRandom method

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: