Traffic Server
  1. Traffic Server
  2. TS-986

ts/experimental has a dependency on netinet/net.h (for struct in_addr)

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.4
    • Component/s: TS API
    • Labels:
      None

      Description

      Alan seems to indicate this is wrong anyways, but just adding this bug so we remember it's probably a bad idea. The offending API is

      tsapi int TSNodeHandleToIPAddr(TSNodeHandle_t *h, struct in_addr *in);

        Activity

        Hide
        Leif Hedstrom added a comment -

        Closing this for now, I've opened a different bug for clustering and the IPv4 dependency.

        Show
        Leif Hedstrom added a comment - Closing this for now, I've opened a different bug for clustering and the IPv4 dependency.
        Hide
        ASF subversion and git services added a comment -

        Commit d6a08ad1b0b5d9c83211889380ee5dd4e579f93a in branch refs/heads/master from Leif Hedstrom
        [ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=d6a08ad ]

        TS-986 ts/experimental has a dependency on netinet/net.h (for struct in_addr)

        Show
        ASF subversion and git services added a comment - Commit d6a08ad1b0b5d9c83211889380ee5dd4e579f93a in branch refs/heads/master from Leif Hedstrom [ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=d6a08ad ] TS-986 ts/experimental has a dependency on netinet/net.h (for struct in_addr)
        Hide
        Leif Hedstrom added a comment -

        So, looking at this a little bit closer, it seems the clustering code is IPv4 only. E.g.

          typedef int TSNodeHandle_t;
        

        and

        #define NODE_HANDLE_TO_IP(h) (*((struct in_addr *) &((h))))
        
        Show
        Leif Hedstrom added a comment - So, looking at this a little bit closer, it seems the clustering code is IPv4 only. E.g. typedef int TSNodeHandle_t; and #define NODE_HANDLE_TO_IP(h) (*((struct in_addr *) &((h))))
        Hide
        Leif Hedstrom added a comment -

        I think as we start using ts/experimental.h for API additions, it's important that things compiles nicely. Even if it means including netinet/net.h (although, how do we do that cross platform safe?). Or, do the forward declarations like amc proposed.

        Show
        Leif Hedstrom added a comment - I think as we start using ts/experimental.h for API additions, it's important that things compiles nicely. Even if it means including netinet/net.h (although, how do we do that cross platform safe?). Or, do the forward declarations like amc proposed.
        Hide
        Leif Hedstrom added a comment -

        Moving to 3.3.2.

        Show
        Leif Hedstrom added a comment - Moving to 3.3.2.
        Hide
        Leif Hedstrom added a comment -

        Moving this out to 3.3.0, please move back to 3.1.4 if this will be worked on soon. Also, take a look at what can be closed here please!

        Show
        Leif Hedstrom added a comment - Moving this out to 3.3.0, please move back to 3.1.4 if this will be worked on soon . Also, take a look at what can be closed here please!
        Hide
        Leif Hedstrom added a comment -

        Moved to 3.1.4, please move bugs back to 3.1.3, which you will work on in the next 2 weeks.

        Show
        Leif Hedstrom added a comment - Moved to 3.1.4, please move bugs back to 3.1.3, which you will work on in the next 2 weeks.
        Hide
        Alan M. Carroll added a comment -

        It should be a sockaddr*, not in_addr. Also, if we want to fix this, we should just put a declaration in name only at the top, e.g.

        "struct sockaddr;"

        OTOH I don't see how we will eliminate dependency on netinet/net.h for something that deals heavily with IP addresses.

        Show
        Alan M. Carroll added a comment - It should be a sockaddr*, not in_addr. Also, if we want to fix this, we should just put a declaration in name only at the top, e.g. "struct sockaddr;" OTOH I don't see how we will eliminate dependency on netinet/net.h for something that deals heavily with IP addresses.

          People

          • Assignee:
            Leif Hedstrom
            Reporter:
            Leif Hedstrom
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development