buildworld broken due to INET6 not being set
- Reply: Gary Jennejohn : "Re: buildworld broken due to INET6 not being set"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 04 Jul 2023 16:48:10 UTC
buildworld breaks because I do not have INET6 defined: /usr/src/sbin/ping/main.c:76:7: error: variable 'ipv4' set but not used [-Werror,-Wunused-but-set-variable] bool ipv4 = false; ^ 1 error generated. ipv4 is set in various places but it's _used_ only bracketed in #if defined(INET) && defined(INET6)...#endif! Note that ipv6 will have the same error if INET6 is defined but INET is not defined due to this chunk of code: #if defined(INET) && defined(INET6) if (inet_pton(AF_INET, argv[argc - 1], &a) == 1) { if (ipv6) errx(1, "IPv6 requested but IPv4 target address " "provided"); hints.ai_family = AF_INET; } else if (inet_pton(AF_INET6, argv[argc - 1], &a6) == 1) { if (ipv4) errx(1, "IPv4 requested but IPv6 target address " "provided"); hints.ai_family = AF_INET6; } else if (ipv6) hints.ai_family = AF_INET6; else if (ipv4) hints.ai_family = AF_INET; else { if (!feature_present("inet6")) hints.ai_family = AF_INET; else if (!feature_present("inet")) hints.ai_family = AF_INET6; else { struct addrinfo *res; memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_RAW; hints.ai_family = AF_UNSPEC; getaddrinfo(argv[argc - 1], NULL, &hints, &res); if (res != NULL) { hints.ai_family = res[0].ai_family; freeaddrinfo(res); } } } #elif defined(INET) hints.ai_family = AF_INET; <== ipv4 set but not used #elif defined(INET6) hints.ai_family = AF_INET6; <== ipv6 set but not used #endif -- Gary Jennejohn