chiark / gitweb /
shared: add MAXSIZE() and use it in resolved
[elogind.git] / src / resolve / resolved-dns-stream.c
index eb78587ae654a865b393e5d990496a33ee663919..8aad5e4df1cc330692d4e77835cc4abea7bc1cc8 100644 (file)
@@ -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 = {};