summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospf6d/database.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2010-05-26 13:56:07 +0000
committernicm <nicm@openbsd.org>2010-05-26 13:56:07 +0000
commite39620e567826900215c8229ffcd47c6f72ea788 (patch)
tree446643802afa38032569946ca4c7021e31e4d240 /usr.sbin/ospf6d/database.c
parentthe addr field in read cap 16 is 8 bytes, not 4. pity, i had really big (diff)
downloadwireguard-openbsd-e39620e567826900215c8229ffcd47c6f72ea788.tar.xz
wireguard-openbsd-e39620e567826900215c8229ffcd47c6f72ea788.zip
Rename some imsg bits to make namespace collisions less likely buf to
ibuf, buf_read to ibuf_read, READ_BUF_SIZE to IBUF_READ_SIZE. ok henning gilles claudio jacekm deraadt
Diffstat (limited to 'usr.sbin/ospf6d/database.c')
-rw-r--r--usr.sbin/ospf6d/database.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/ospf6d/database.c b/usr.sbin/ospf6d/database.c
index 20c818eb55f..5590cf91eb6 100644
--- a/usr.sbin/ospf6d/database.c
+++ b/usr.sbin/ospf6d/database.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: database.c,v 1.9 2008/12/28 20:08:31 claudio Exp $ */
+/* $OpenBSD: database.c,v 1.10 2010/05/26 13:56:08 nicm Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -43,11 +43,11 @@ send_db_description(struct nbr *nbr)
struct in6_addr dst;
struct db_dscrp_hdr dd_hdr;
struct lsa_entry *le, *nle;
- struct buf *buf;
+ struct ibuf *buf;
int ret = 0;
u_int8_t bits = 0;
- if ((buf = buf_open(nbr->iface->mtu - sizeof(struct ip))) == NULL)
+ if ((buf = ibuf_open(nbr->iface->mtu - sizeof(struct ip))) == NULL)
fatal("send_db_description");
/* OSPF header */
@@ -55,7 +55,7 @@ send_db_description(struct nbr *nbr)
goto fail;
/* reserve space for database description header */
- if (buf_reserve(buf, sizeof(dd_hdr)) == NULL)
+ if (ibuf_reserve(buf, sizeof(dd_hdr)) == NULL)
goto fail;
switch (nbr->state) {
@@ -94,7 +94,7 @@ send_db_description(struct nbr *nbr)
buf->wpos + sizeof(struct lsa_hdr) < buf->max -
MD5_DIGEST_LENGTH; le = nle) {
nbr->dd_end = nle = TAILQ_NEXT(le, entry);
- if (buf_add(buf, le->le_lsa, sizeof(struct lsa_hdr)))
+ if (ibuf_add(buf, le->le_lsa, sizeof(struct lsa_hdr)))
goto fail;
}
break;
@@ -141,7 +141,7 @@ send_db_description(struct nbr *nbr)
dd_hdr.bits = bits;
dd_hdr.dd_seq_num = htonl(nbr->dd_seq_num);
- memcpy(buf_seek(buf, sizeof(struct ospf_hdr), sizeof(dd_hdr)),
+ memcpy(ibuf_seek(buf, sizeof(struct ospf_hdr), sizeof(dd_hdr)),
&dd_hdr, sizeof(dd_hdr));
/* calculate checksum */
@@ -151,11 +151,11 @@ send_db_description(struct nbr *nbr)
/* transmit packet */
ret = send_packet(nbr->iface, buf->buf, buf->wpos, &dst);
done:
- buf_free(buf);
+ ibuf_free(buf);
return (ret);
fail:
log_warn("send_db_description");
- buf_free(buf);
+ ibuf_free(buf);
return (-1);
}