uNetworking / uSockets

Miniscule cross-platform eventing, networking & crypto for async applications
Apache License 2.0
1.29k stars 267 forks source link

0.8.2 fails to build on FreeBSD: use of undeclared identifier 'IP_PKTINFO' #186

Closed yurivict closed 1 year ago

yurivict commented 2 years ago
cc -O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing  -DLIBUS_USE_OPENSSL -std=c11 -Isrc -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c
src/bsd.c:124:66: error: use of undeclared identifier 'IP_PKTINFO'
        if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_PKTINFO) {
                                                                 ^
src/bsd.c:126:27: error: incomplete definition of type 'struct in_pktinfo'
            memcpy(ip, &pi->ipi_addr, 4);
                        ~~^
src/bsd.c:125:20: note: forward declaration of 'struct in_pktinfo'
            struct in_pktinfo *pi = (struct in_pktinfo *) CMSG_DATA(cmsg);
                   ^
src/bsd.c:579:50: error: use of undeclared identifier 'IP_PKTINFO'
            if (setsockopt(listenFd, IPPROTO_IP, IP_PKTINFO, &enabled, sizeof(enabled)) != 0) {
                                                 ^
3 errors generated.

FreeBSD 13.1 STABLE