From b0ea642a7b7d85afe97fb2bcd2b602b893537343 Mon Sep 17 00:00:00 2001 From: claudio Date: Fri, 9 Aug 2024 14:00:48 +0000 Subject: [PATCH] Remove the ibuf_size(pdu) % sizeof(uint32_t) == 0 since it is already done in rtr_parse_header(). No need to do it twice. --- usr.sbin/bgpd/rtr_proto.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bgpd/rtr_proto.c b/usr.sbin/bgpd/rtr_proto.c index 5cc23a7021b..9619f1f5936 100644 --- a/usr.sbin/bgpd/rtr_proto.c +++ b/usr.sbin/bgpd/rtr_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtr_proto.c,v 1.36 2024/08/09 13:52:09 claudio Exp $ */ +/* $OpenBSD: rtr_proto.c,v 1.37 2024/08/09 14:00:48 claudio Exp $ */ /* * Copyright (c) 2020 Claudio Jeker @@ -745,8 +745,7 @@ rtr_parse_aspa(struct rtr_session *rs, struct ibuf *pdu) uint32_t cnt, i; uint8_t flags; - if (ibuf_get(pdu, &rtr_aspa, sizeof(rtr_aspa)) == -1 || - ibuf_size(pdu) % sizeof(uint32_t) != 0) + if (ibuf_get(pdu, &rtr_aspa, sizeof(rtr_aspa)) == -1) goto badlen; flags = rtr_aspa.hdr.flags; -- 2.20.1