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

getprotobyname should not be used

XMLWordPrintable

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

      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.

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

              Created:
              Updated:
              Resolved: