Skip to content

Commit f96ddb4

Browse files
committed
LocalIP (BSD): fix compiling
1 parent 1b0a65e commit f96ddb4

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/detection/localip/localip_linux.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,15 @@ static bool isIPv6AddressPreferred(const char* ifname, struct sockaddr_in6* addr
171171

172172
if (ioctl(sockfd, SIOCGIFAFLAG_IN6, &ifr6) != 0)
173173
return true;
174-
175-
return !(ifr6.ifr_ifru.ifru_flags6 & (IN6_IFF_DEPRECATED | IN6_IFF_TEMPORARY | IN6_IFF_TENTATIVE | IN6_IFF_DUPLICATED | IN6_IFF_OPTIMISTIC));
174+
#ifdef IN6_IFF_PREFER_SOURCE
175+
if (ifr6.ifr_ifru.ifru_flags6 & IN6_IFF_PREFER_SOURCE)
176+
return true;
177+
#endif
178+
return !(ifr6.ifr_ifru.ifru_flags6 & (IN6_IFF_DEPRECATED | IN6_IFF_TEMPORARY | IN6_IFF_TENTATIVE | IN6_IFF_DUPLICATED
179+
#ifdef IN6_IFF_OPTIMISTIC
180+
| IN6_IFF_OPTIMISTIC
181+
#endif
182+
));
176183
#elif __linux__
177184
FF_UNUSED(ifname);
178185

0 commit comments

Comments
 (0)