]> granicus.if.org Git - pdns/commitdiff
Comment on cmsgbuf_aligned in the proper place.
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 26 Jun 2019 09:14:25 +0000 (11:14 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 26 Jun 2019 09:14:25 +0000 (11:14 +0200)
pdns/misc.cc
pdns/misc.hh

index 4aedbc11b7514ce4fb1111747ad4a49d13cb2c8e..2686b0fc46c640f890ee0acc3595ea55bb03c706 100644 (file)
@@ -885,8 +885,6 @@ Regex::Regex(const string &expr)
 // with msgh->msg_controllen, please refer to https://github.com/PowerDNS/pdns/pull/3962
 // first.
 // Note that cmsgbuf should be aligned the same as a struct cmsghdr
-// This can be achieved by declaring it as
-//    union { struct cmsghdr hdr; char buf[CMSG_SPACE(spaceneeded)]; } cmsgbuf;
 void addCMsgSrcAddr(struct msghdr* msgh, cmsgbuf_aligned* cmsgbuf, const ComboAddress* source, int itfIndex)
 {
   struct cmsghdr *cmsg = NULL;
index 67472bd577af92a5f9c31ea1109a9a9eda506e1b..ca327e0920fa32d15fded37da04f68f47d5aa622 100644 (file)
@@ -516,6 +516,7 @@ private:
 
 union ComboAddress;
 
+// An aligned type to hold cmsgbufs. See https://man.openbsd.org/CMSG_DATA
 typedef union { struct cmsghdr hdr; char buf[256]; } cmsgbuf_aligned;
 
 /* itfIndex is an interface index, as returned by if_nametoindex(). 0 means default. */