Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rping.c on FreeBSD #20

Closed
wants to merge 1 commit into from
Closed

Fix rping.c on FreeBSD #20

wants to merge 1 commit into from

Commits on Jan 14, 2022

  1. Fix rping.c on FreeBSD

    The include directive of `netinet/in.h` must be present before `resolv.h` on FreeBSD, otherwise, the following errors will occur:
    
    ```
    rping.c:82:27: error: use of undeclared identifier 'IPPROTO_TCP'
      if (type == 0) { type = IPPROTO_TCP; } else { type = IPPROTO_UDP; }
                              ^
    rping.c:82:56: error: use of undeclared identifier 'IPPROTO_UDP'
      if (type == 0) { type = IPPROTO_TCP; } else { type = IPPROTO_UDP; }
                                                           ^
    rping.c:117:24: error: variable has incomplete type 'struct sockaddr_in'
        struct sockaddr_in c_address;
                           ^
    rping.c:117:12: note: forward declaration of 'struct sockaddr_in'
        struct sockaddr_in c_address;
               ^
    rping.c:128:17: error: use of undeclared identifier 'IPPROTO_UDP'
                          type == IPPROTO_UDP ? SOCK_DGRAM : SOCK_STREAM,
                                  ^
    4 errors generated.
    ```
    
    The reason is that the `resolv.h` on FreeBSD is not yet self-contained, see this bug report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=182466
    
    This fix was committed with the FreeBSD port `net/R-cran-pingr` in https://cgit.freebsd.org/ports/commit/?id=fce80f530301d0079d84bc4b818ba957ad29617b.
    yzgyyang authored Jan 14, 2022
    Configuration menu
    Copy the full SHA
    00fe056 View commit details
    Browse the repository at this point in the history