-/* $OpenBSD: auth.c,v 1.21 2023/06/20 15:19:55 claudio Exp $ */
+/* $OpenBSD: auth.c,v 1.22 2023/07/03 09:40:47 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
switch (iface->auth_type) {
case AUTH_NONE:
- chksum = in_cksum(buf->buf, ibuf_size(buf));
+ chksum = in_cksum(ibuf_data(buf), ibuf_size(buf));
if (ibuf_set(buf, offsetof(struct ospf_hdr, chksum),
&chksum, sizeof(chksum)) == -1)
fatalx("auth_gen: ibuf_set failed");
break;
case AUTH_SIMPLE:
- chksum = in_cksum(buf->buf, ibuf_size(buf));
+ chksum = in_cksum(ibuf_data(buf), ibuf_size(buf));
if (ibuf_set(buf, offsetof(struct ospf_hdr, chksum),
&chksum, sizeof(chksum)) == -1)
fatalx("auth_gen: ibuf_set failed");
/* calculate MD5 digest */
MD5Init(&hash);
- MD5Update(&hash, buf->buf, ibuf_size(buf));
+ MD5Update(&hash, ibuf_data(buf), ibuf_size(buf));
MD5Update(&hash, digest, MD5_DIGEST_LENGTH);
MD5Final(digest, &hash);
-/* $OpenBSD: ospfe.c,v 1.112 2023/06/20 15:19:55 claudio Exp $ */
+/* $OpenBSD: ospfe.c,v 1.113 2023/07/03 09:40:47 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
if (ibuf_set(buf, 0, &lsa_hdr, sizeof(lsa_hdr)) == -1)
fatal("orig_rtr_lsa: ibuf_set failed");
- chksum = iso_cksum(buf->buf, ibuf_size(buf), LS_CKSUM_OFFSET);
+ chksum = iso_cksum(ibuf_data(buf), ibuf_size(buf), LS_CKSUM_OFFSET);
if (ibuf_set_n16(buf, LS_CKSUM_OFFSET, chksum) == -1)
fatal("orig_rtr_lsa: ibuf_set_n16 failed");
if (self && num_links)
imsg_compose_event(iev_rde, IMSG_LS_UPD, self->peerid, 0,
- -1, buf->buf, ibuf_size(buf));
+ -1, ibuf_data(buf), ibuf_size(buf));
else
log_warnx("orig_rtr_lsa: empty area %s",
inet_ntoa(area->id));
if (ibuf_set(buf, 0, &lsa_hdr, sizeof(lsa_hdr)) == -1)
fatal("orig_net_lsa: ibuf_set failed");
- chksum = iso_cksum(buf->buf, ibuf_size(buf), LS_CKSUM_OFFSET);
+ chksum = iso_cksum(ibuf_data(buf), ibuf_size(buf), LS_CKSUM_OFFSET);
if (ibuf_set_n16(buf, LS_CKSUM_OFFSET, chksum) == -1)
fatal("orig_net_lsa: ibuf_set_n16 failed");
imsg_compose_event(iev_rde, IMSG_LS_UPD, iface->self->peerid, 0,
- -1, buf->buf, ibuf_size(buf));
+ -1, ibuf_data(buf), ibuf_size(buf));
ibuf_free(buf);
}
-/* $OpenBSD: packet.c,v 1.36 2021/11/03 21:40:03 sthen Exp $ */
+/* $OpenBSD: packet.c,v 1.37 2023/07/03 09:40:47 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
bzero(&msg, sizeof(msg));
iov[0].iov_base = &ip_hdr;
iov[0].iov_len = sizeof(ip_hdr);
- iov[1].iov_base = buf->buf;
+ iov[1].iov_base = ibuf_data(buf);
iov[1].iov_len = ibuf_size(buf);
msg.msg_name = dst;
msg.msg_namelen = sizeof(*dst);