X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fresolve%2Fresolved-dns-stream.c;h=3690679ec64133c5569f3defbd5ea1c473cc4ddf;hb=c75dbf9bea577057c5a6ee3d52db6e13aa6caa57;hp=eb78587ae654a865b393e5d990496a33ee663919;hpb=747c0ff5648b707abb601f58eefcfd92a7d41695;p=elogind.git diff --git a/src/resolve/resolved-dns-stream.c b/src/resolve/resolved-dns-stream.c index eb78587ae..3690679ec 100644 --- a/src/resolve/resolved-dns-stream.c +++ b/src/resolve/resolved-dns-stream.c @@ -64,7 +64,7 @@ static int dns_stream_complete(DnsStream *s, int error) { static int dns_stream_identify(DnsStream *s) { union { struct cmsghdr header; /* For alignment */ - uint8_t buffer[CMSG_SPACE(MAX(sizeof(struct in_pktinfo), sizeof(struct in6_pktinfo))) + uint8_t buffer[CMSG_SPACE(MAXSIZE(struct in_pktinfo, struct in6_pktinfo)) + EXTRA_CMSG_SPACE /* kernel appears to require extra space */]; } control; struct msghdr mh = {}; @@ -157,7 +157,7 @@ static int dns_stream_identify(DnsStream *s) { * device if the connection came from the local host since it * avoids the routing table in such a case. Let's unset the * interface index in such a case. */ - if (s->ifindex > 0 && manager_ifindex_is_loopback(s->manager, s->ifindex) != 0) + if (s->ifindex == LOOPBACK_IFINDEX) s->ifindex = 0; /* If we don't know the interface index still, we look for the