diff options
-rw-r--r-- | usr.sbin/bgpd/imsg.c | 14 | ||||
-rw-r--r-- | usr.sbin/dvmrpd/imsg.c | 14 | ||||
-rw-r--r-- | usr.sbin/ldpd/imsg.c | 14 | ||||
-rw-r--r-- | usr.sbin/ntpd/imsg.c | 14 | ||||
-rw-r--r-- | usr.sbin/ospf6d/imsg.c | 14 | ||||
-rw-r--r-- | usr.sbin/ospfd/imsg.c | 14 | ||||
-rw-r--r-- | usr.sbin/relayd/imsg.c | 14 | ||||
-rw-r--r-- | usr.sbin/ripd/imsg.c | 14 | ||||
-rw-r--r-- | usr.sbin/smtpd/imsg.c | 14 | ||||
-rw-r--r-- | usr.sbin/snmpd/imsg.c | 14 | ||||
-rw-r--r-- | usr.sbin/ypldap/imsg.c | 14 |
11 files changed, 121 insertions, 33 deletions
diff --git a/usr.sbin/bgpd/imsg.c b/usr.sbin/bgpd/imsg.c index b2a7d0a494f..4239b154560 100644 --- a/usr.sbin/bgpd/imsg.c +++ b/usr.sbin/bgpd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.44 2009/06/06 22:11:25 eric Exp $ */ +/* $OpenBSD: imsg.c,v 1.45 2009/06/07 00:40:46 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -105,8 +105,12 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) errno = ERANGE; return (-1); } - if (imsg->hdr.len > av) + if ((imsg->hdr.len = ntohs(imsg->hdr.len)) > av) return (0); + imsg->hdr.type = ntohl(imsg->hdr.type); + imsg->hdr.flags = ntohs(imsg->hdr.flags); + imsg->hdr.peerid = ntohl(imsg->hdr.peerid); + imsg->hdr.pid = ntohl(imsg->hdr.pid); datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { @@ -212,7 +216,11 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg) struct imsg_hdr *hdr; hdr = (struct imsg_hdr *)msg->buf; - hdr->len = (u_int16_t)msg->wpos; + hdr->type = htonl(hdr->type); + hdr->len = htons(msg->wpos); + hdr->flags = htons(hdr->flags); + hdr->peerid = htonl(hdr->peerid); + hdr->pid = htonl(hdr->pid); buf_close(&ibuf->w, msg); } diff --git a/usr.sbin/dvmrpd/imsg.c b/usr.sbin/dvmrpd/imsg.c index 0d954e9e16f..06f7fa11117 100644 --- a/usr.sbin/dvmrpd/imsg.c +++ b/usr.sbin/dvmrpd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.4 2009/06/06 22:11:25 eric Exp $ */ +/* $OpenBSD: imsg.c,v 1.5 2009/06/07 00:40:46 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -105,8 +105,12 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) errno = ERANGE; return (-1); } - if (imsg->hdr.len > av) + if ((imsg->hdr.len = ntohs(imsg->hdr.len)) > av) return (0); + imsg->hdr.type = ntohl(imsg->hdr.type); + imsg->hdr.flags = ntohs(imsg->hdr.flags); + imsg->hdr.peerid = ntohl(imsg->hdr.peerid); + imsg->hdr.pid = ntohl(imsg->hdr.pid); datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { @@ -212,7 +216,11 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg) struct imsg_hdr *hdr; hdr = (struct imsg_hdr *)msg->buf; - hdr->len = (u_int16_t)msg->wpos; + hdr->type = htonl(hdr->type); + hdr->len = htons(msg->wpos); + hdr->flags = htons(hdr->flags); + hdr->peerid = htonl(hdr->peerid); + hdr->pid = htonl(hdr->pid); buf_close(&ibuf->w, msg); } diff --git a/usr.sbin/ldpd/imsg.c b/usr.sbin/ldpd/imsg.c index 9a550c1cfe0..88e022c6bfc 100644 --- a/usr.sbin/ldpd/imsg.c +++ b/usr.sbin/ldpd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.3 2009/06/06 22:11:25 eric Exp $ */ +/* $OpenBSD: imsg.c,v 1.4 2009/06/07 00:40:46 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -105,8 +105,12 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) errno = ERANGE; return (-1); } - if (imsg->hdr.len > av) + if ((imsg->hdr.len = ntohs(imsg->hdr.len)) > av) return (0); + imsg->hdr.type = ntohl(imsg->hdr.type); + imsg->hdr.flags = ntohs(imsg->hdr.flags); + imsg->hdr.peerid = ntohl(imsg->hdr.peerid); + imsg->hdr.pid = ntohl(imsg->hdr.pid); datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { @@ -212,7 +216,11 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg) struct imsg_hdr *hdr; hdr = (struct imsg_hdr *)msg->buf; - hdr->len = (u_int16_t)msg->wpos; + hdr->type = htonl(hdr->type); + hdr->len = htons(msg->wpos); + hdr->flags = htons(hdr->flags); + hdr->peerid = htonl(hdr->peerid); + hdr->pid = htonl(hdr->pid); buf_close(&ibuf->w, msg); } diff --git a/usr.sbin/ntpd/imsg.c b/usr.sbin/ntpd/imsg.c index 0815b1c63e3..a70cb77dd4c 100644 --- a/usr.sbin/ntpd/imsg.c +++ b/usr.sbin/ntpd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.14 2009/06/06 22:11:25 eric Exp $ */ +/* $OpenBSD: imsg.c,v 1.15 2009/06/07 00:40:46 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -105,8 +105,12 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) errno = ERANGE; return (-1); } - if (imsg->hdr.len > av) + if ((imsg->hdr.len = ntohs(imsg->hdr.len)) > av) return (0); + imsg->hdr.type = ntohl(imsg->hdr.type); + imsg->hdr.flags = ntohs(imsg->hdr.flags); + imsg->hdr.peerid = ntohl(imsg->hdr.peerid); + imsg->hdr.pid = ntohl(imsg->hdr.pid); datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { @@ -212,7 +216,11 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg) struct imsg_hdr *hdr; hdr = (struct imsg_hdr *)msg->buf; - hdr->len = (u_int16_t)msg->wpos; + hdr->type = htonl(hdr->type); + hdr->len = htons(msg->wpos); + hdr->flags = htons(hdr->flags); + hdr->peerid = htonl(hdr->peerid); + hdr->pid = htonl(hdr->pid); buf_close(&ibuf->w, msg); } diff --git a/usr.sbin/ospf6d/imsg.c b/usr.sbin/ospf6d/imsg.c index 9a550c1cfe0..88e022c6bfc 100644 --- a/usr.sbin/ospf6d/imsg.c +++ b/usr.sbin/ospf6d/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.3 2009/06/06 22:11:25 eric Exp $ */ +/* $OpenBSD: imsg.c,v 1.4 2009/06/07 00:40:46 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -105,8 +105,12 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) errno = ERANGE; return (-1); } - if (imsg->hdr.len > av) + if ((imsg->hdr.len = ntohs(imsg->hdr.len)) > av) return (0); + imsg->hdr.type = ntohl(imsg->hdr.type); + imsg->hdr.flags = ntohs(imsg->hdr.flags); + imsg->hdr.peerid = ntohl(imsg->hdr.peerid); + imsg->hdr.pid = ntohl(imsg->hdr.pid); datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { @@ -212,7 +216,11 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg) struct imsg_hdr *hdr; hdr = (struct imsg_hdr *)msg->buf; - hdr->len = (u_int16_t)msg->wpos; + hdr->type = htonl(hdr->type); + hdr->len = htons(msg->wpos); + hdr->flags = htons(hdr->flags); + hdr->peerid = htonl(hdr->peerid); + hdr->pid = htonl(hdr->pid); buf_close(&ibuf->w, msg); } diff --git a/usr.sbin/ospfd/imsg.c b/usr.sbin/ospfd/imsg.c index f6ceb1a5f9a..bd88bed1843 100644 --- a/usr.sbin/ospfd/imsg.c +++ b/usr.sbin/ospfd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.15 2009/06/06 22:11:25 eric Exp $ */ +/* $OpenBSD: imsg.c,v 1.16 2009/06/07 00:40:46 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -105,8 +105,12 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) errno = ERANGE; return (-1); } - if (imsg->hdr.len > av) + if ((imsg->hdr.len = ntohs(imsg->hdr.len)) > av) return (0); + imsg->hdr.type = ntohl(imsg->hdr.type); + imsg->hdr.flags = ntohs(imsg->hdr.flags); + imsg->hdr.peerid = ntohl(imsg->hdr.peerid); + imsg->hdr.pid = ntohl(imsg->hdr.pid); datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { @@ -212,7 +216,11 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg) struct imsg_hdr *hdr; hdr = (struct imsg_hdr *)msg->buf; - hdr->len = (u_int16_t)msg->wpos; + hdr->type = htonl(hdr->type); + hdr->len = htons(msg->wpos); + hdr->flags = htons(hdr->flags); + hdr->peerid = htonl(hdr->peerid); + hdr->pid = htonl(hdr->pid); buf_close(&ibuf->w, msg); } diff --git a/usr.sbin/relayd/imsg.c b/usr.sbin/relayd/imsg.c index 41d69f80792..8245c60e6ec 100644 --- a/usr.sbin/relayd/imsg.c +++ b/usr.sbin/relayd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.25 2009/06/06 22:11:25 eric Exp $ */ +/* $OpenBSD: imsg.c,v 1.26 2009/06/07 00:40:46 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -105,8 +105,12 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) errno = ERANGE; return (-1); } - if (imsg->hdr.len > av) + if ((imsg->hdr.len = ntohs(imsg->hdr.len)) > av) return (0); + imsg->hdr.type = ntohl(imsg->hdr.type); + imsg->hdr.flags = ntohs(imsg->hdr.flags); + imsg->hdr.peerid = ntohl(imsg->hdr.peerid); + imsg->hdr.pid = ntohl(imsg->hdr.pid); datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { @@ -212,7 +216,11 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg) struct imsg_hdr *hdr; hdr = (struct imsg_hdr *)msg->buf; - hdr->len = (u_int16_t)msg->wpos; + hdr->type = htonl(hdr->type); + hdr->len = htons(msg->wpos); + hdr->flags = htons(hdr->flags); + hdr->peerid = htonl(hdr->peerid); + hdr->pid = htonl(hdr->pid); buf_close(&ibuf->w, msg); } diff --git a/usr.sbin/ripd/imsg.c b/usr.sbin/ripd/imsg.c index 0d954e9e16f..06f7fa11117 100644 --- a/usr.sbin/ripd/imsg.c +++ b/usr.sbin/ripd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.4 2009/06/06 22:11:25 eric Exp $ */ +/* $OpenBSD: imsg.c,v 1.5 2009/06/07 00:40:46 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -105,8 +105,12 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) errno = ERANGE; return (-1); } - if (imsg->hdr.len > av) + if ((imsg->hdr.len = ntohs(imsg->hdr.len)) > av) return (0); + imsg->hdr.type = ntohl(imsg->hdr.type); + imsg->hdr.flags = ntohs(imsg->hdr.flags); + imsg->hdr.peerid = ntohl(imsg->hdr.peerid); + imsg->hdr.pid = ntohl(imsg->hdr.pid); datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { @@ -212,7 +216,11 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg) struct imsg_hdr *hdr; hdr = (struct imsg_hdr *)msg->buf; - hdr->len = (u_int16_t)msg->wpos; + hdr->type = htonl(hdr->type); + hdr->len = htons(msg->wpos); + hdr->flags = htons(hdr->flags); + hdr->peerid = htonl(hdr->peerid); + hdr->pid = htonl(hdr->pid); buf_close(&ibuf->w, msg); } diff --git a/usr.sbin/smtpd/imsg.c b/usr.sbin/smtpd/imsg.c index 6ee66c7d718..f2e35d7cf61 100644 --- a/usr.sbin/smtpd/imsg.c +++ b/usr.sbin/smtpd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.7 2009/06/06 22:11:25 eric Exp $ */ +/* $OpenBSD: imsg.c,v 1.8 2009/06/07 00:40:46 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -105,8 +105,12 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) errno = ERANGE; return (-1); } - if (imsg->hdr.len > av) + if ((imsg->hdr.len = ntohs(imsg->hdr.len)) > av) return (0); + imsg->hdr.type = ntohl(imsg->hdr.type); + imsg->hdr.flags = ntohs(imsg->hdr.flags); + imsg->hdr.peerid = ntohl(imsg->hdr.peerid); + imsg->hdr.pid = ntohl(imsg->hdr.pid); datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { @@ -212,7 +216,11 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg) struct imsg_hdr *hdr; hdr = (struct imsg_hdr *)msg->buf; - hdr->len = (u_int16_t)msg->wpos; + hdr->type = htonl(hdr->type); + hdr->len = htons(msg->wpos); + hdr->flags = htons(hdr->flags); + hdr->peerid = htonl(hdr->peerid); + hdr->pid = htonl(hdr->pid); buf_close(&ibuf->w, msg); } diff --git a/usr.sbin/snmpd/imsg.c b/usr.sbin/snmpd/imsg.c index 6ee66c7d718..f2e35d7cf61 100644 --- a/usr.sbin/snmpd/imsg.c +++ b/usr.sbin/snmpd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.7 2009/06/06 22:11:25 eric Exp $ */ +/* $OpenBSD: imsg.c,v 1.8 2009/06/07 00:40:46 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -105,8 +105,12 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) errno = ERANGE; return (-1); } - if (imsg->hdr.len > av) + if ((imsg->hdr.len = ntohs(imsg->hdr.len)) > av) return (0); + imsg->hdr.type = ntohl(imsg->hdr.type); + imsg->hdr.flags = ntohs(imsg->hdr.flags); + imsg->hdr.peerid = ntohl(imsg->hdr.peerid); + imsg->hdr.pid = ntohl(imsg->hdr.pid); datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { @@ -212,7 +216,11 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg) struct imsg_hdr *hdr; hdr = (struct imsg_hdr *)msg->buf; - hdr->len = (u_int16_t)msg->wpos; + hdr->type = htonl(hdr->type); + hdr->len = htons(msg->wpos); + hdr->flags = htons(hdr->flags); + hdr->peerid = htonl(hdr->peerid); + hdr->pid = htonl(hdr->pid); buf_close(&ibuf->w, msg); } diff --git a/usr.sbin/ypldap/imsg.c b/usr.sbin/ypldap/imsg.c index 0dac78f5c85..6b158a676cf 100644 --- a/usr.sbin/ypldap/imsg.c +++ b/usr.sbin/ypldap/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.5 2009/06/06 22:11:25 eric Exp $ */ +/* $OpenBSD: imsg.c,v 1.6 2009/06/07 00:40:46 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -105,8 +105,12 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) errno = ERANGE; return (-1); } - if (imsg->hdr.len > av) + if ((imsg->hdr.len = ntohs(imsg->hdr.len)) > av) return (0); + imsg->hdr.type = ntohl(imsg->hdr.type); + imsg->hdr.flags = ntohs(imsg->hdr.flags); + imsg->hdr.peerid = ntohl(imsg->hdr.peerid); + imsg->hdr.pid = ntohl(imsg->hdr.pid); datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { @@ -212,7 +216,11 @@ imsg_close(struct imsgbuf *ibuf, struct buf *msg) struct imsg_hdr *hdr; hdr = (struct imsg_hdr *)msg->buf; - hdr->len = (u_int16_t)msg->wpos; + hdr->type = htonl(hdr->type); + hdr->len = htons(msg->wpos); + hdr->flags = htons(hdr->flags); + hdr->peerid = htonl(hdr->peerid); + hdr->pid = htonl(hdr->pid); buf_close(&ibuf->w, msg); } |