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

getprotobyname should not be used

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • None
    • 21
    • core-svc
    • b05

    Description

      The function getprotobyname is not thread-safe; it returns a pointer to a statically allocated structure. It should not be used.

      The function is used to retrieve protocol number for TCP. There's a compile-time constant IPPROTO_TCP that can be used instead. While the protocol number for TCP could theoretically be changed, this is something we have never observed in practice, and it probably doesn't make sense to test.

      Attachments

        Issue Links

          Activity

            People

              djelinski Daniel Jelinski
              djelinski Daniel Jelinski
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: