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

getByName(null) should not return a broadcast address.

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.0prebeta2
    • CPU:
      sparc
    • OS:
      generic
    • Verification:
      Not verified

      Description

      From ###@###.### (Caveh Jalali)
      Newsgroups: fp.java-interest
      Subject: inetAddress.getByName/Socket bug
      Date: 4 Oct 1995 00:39:34 -0700


      this is a strange one:

      creating Socket(null, <some-port>, false) actually creates a broadcast
      socket instead of a socket to the local machine! it appears that the
      inetAddress for a null hostname is 0.0.0.0, and trying to send to that
      address is obviously a broadcast. getByName() should probably set the
      inet address to 127.0.0.1 instead.

      the docs for getByName() state:

      Returns a network address for the indicated host. A host name of null
      refers to any address for the local machine.

      --
      00c
      -
      Note to Sun employees: this is an EXTERNAL mailing list!
      Info: send 'help' to ###@###.###

        Attachments

          Activity

            People

            Assignee:
            duke J. Duke (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: