diff options
-rw-r--r-- | usr.sbin/ldpd/hello.c | 4 | ||||
-rw-r--r-- | usr.sbin/ldpd/labelmapping.c | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/ldpd/hello.c b/usr.sbin/ldpd/hello.c index 0b6e1eaddc6..8ba8c4be4b9 100644 --- a/usr.sbin/ldpd/hello.c +++ b/usr.sbin/ldpd/hello.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hello.c,v 1.58 2019/12/12 00:10:29 yasuoka Exp $ */ +/* $OpenBSD: hello.c,v 1.59 2023/07/03 11:51:27 claudio Exp $ */ /* * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org> @@ -139,7 +139,7 @@ send_hello(enum hello_type type, struct iface_af *ia, struct tnbr *tnbr) return (-1); } - send_packet(fd, af, &dst, ia, buf->buf, buf->wpos); + send_packet(fd, af, &dst, ia, ibuf_data(buf), ibuf_size(buf)); ibuf_free(buf); return (0); diff --git a/usr.sbin/ldpd/labelmapping.c b/usr.sbin/ldpd/labelmapping.c index cfafb4366c0..730f61f288f 100644 --- a/usr.sbin/ldpd/labelmapping.c +++ b/usr.sbin/ldpd/labelmapping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: labelmapping.c,v 1.68 2017/03/04 00:15:35 renato Exp $ */ +/* $OpenBSD: labelmapping.c,v 1.69 2023/07/03 11:51:27 claudio Exp $ */ /* * Copyright (c) 2014, 2015 Renato Westphal <renato@openbsd.org> @@ -22,6 +22,7 @@ #include <arpa/inet.h> #include <netmpls/mpls.h> #include <limits.h> +#include <stddef.h> #include <stdlib.h> #include <string.h> @@ -39,10 +40,8 @@ static void log_msg_mapping(int, uint16_t, struct nbr *, struct map *); static void enqueue_pdu(struct nbr *nbr, struct ibuf *buf, uint16_t size) { - struct ldp_hdr *ldp_hdr; - - ldp_hdr = ibuf_seek(buf, 0, sizeof(struct ldp_hdr)); - ldp_hdr->length = htons(size); + if (ibuf_set_n16(buf, offsetof(struct ldp_hdr, length), size) == -1) + fatal(__func__); evbuf_enqueue(&nbr->tcp->wbuf, buf); } |