- constants for DNS flags.
- compilation without locks fixup.
- removed include of unportable header from lookup3.c.
+ - more portable use of struct msghdr.
2 April 2007: Wouter
- check sizes of udp received messages, not too short.
/* [0]=reserved for tcplen, [1]=id, [2]=flags, [3]=message */
struct iovec iov[4];
- iov[1].iov_base = &qid;
+ iov[1].iov_base = (void*)&qid;
iov[1].iov_len = sizeof(uint16_t);
if(!cached) {
/* original flags, copy RD bit from query. */
}
log_assert(qflags & BIT_QR); /* QR bit must be on in our replies */
qflags = htons(qflags);
- iov[2].iov_base = &qflags;
+ iov[2].iov_base = (void*)&qflags;
iov[2].iov_len = sizeof(uint16_t);
- iov[3].iov_base = rep->reply;
+ iov[3].iov_base = (void*)rep->reply;
iov[3].iov_len = rep->replysize;
comm_point_send_reply_iov(comrep, iov, 4);
}
log_assert(repinfo && repinfo->c);
if(repinfo->c->type == comm_udp) {
struct msghdr hdr;
+ memset(&hdr, 0, sizeof(hdr));
hdr.msg_name = &repinfo->addr;
hdr.msg_namelen = repinfo->addrlen;
hdr.msg_iov = iov + 1;
hdr.msg_iovlen = (TYPE_MSGIOVLEN)(iovlen - 1);
- hdr.msg_control = NULL;
- hdr.msg_controllen = 0;
- hdr.msg_flags = 0;
/* note that number of characters sent is not checked. */
if(sendmsg(repinfo->c->fd, &hdr, 0) == -1)
log_err("sendmsg: %s", strerror(errno));
for(i=1; i<iovlen; i++)
len += iov[i].iov_len;
len = htons(len);
- iov[0].iov_base = &len;
+ iov[0].iov_base = (void*)&len;
iov[0].iov_len = sizeof(uint16_t);
if((done=writev(repinfo->c->fd, iov, (int)iovlen)) == -1) {
#ifdef S_SPLINT_S