Replace LLINDEX macro not present on all BSDs with the code

FreeBSD < 10 doesn't have the LLINDEX macro either in net/if_dl.h, so besides
OpenBSD yet another condition to declare the LLINDEX macro for systems where
it isn't present does make it more complicated than replacing its usage with
the actual code.

Change-Id: I7e8ef3e265564526e05ec3115f9fa765d399f045
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ralf Nolden 2016-07-01 10:33:43 +02:00
parent daade9b90d
commit b7744e0b05

View File

@ -906,10 +906,7 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxS
if (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_RECVIF
&& cmsgptr->cmsg_len >= CMSG_LEN(sizeof(sockaddr_dl))) {
sockaddr_dl *sdl = reinterpret_cast<sockaddr_dl *>(CMSG_DATA(cmsgptr));
# if defined(Q_OS_OPENBSD)
# define LLINDEX(s) ((s)->sdl_index)
# endif
header->ifindex = LLINDEX(sdl);
header->ifindex = sdl->sdl_index;
}
# endif
#endif