From f8d44979546941005cf8096358d818d6b6a40b80 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 3 Nov 2021 13:48:46 +0000 Subject: [PATCH] use some sizeof, rather than INADDRSZ/IN6ADDRSZ; ok claudio --- usr.sbin/eigrpd/eigrpd.h | 5 +---- usr.sbin/eigrpd/tlv.c | 10 +++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/usr.sbin/eigrpd/eigrpd.h b/usr.sbin/eigrpd/eigrpd.h index 41d5fdfbdb6..dcf063ae3e1 100644 --- a/usr.sbin/eigrpd/eigrpd.h +++ b/usr.sbin/eigrpd/eigrpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: eigrpd.h,v 1.26 2021/01/19 10:53:25 claudio Exp $ */ +/* $OpenBSD: eigrpd.h,v 1.27 2021/11/03 13:48:46 deraadt Exp $ */ /* * Copyright (c) 2015 Renato Westphal @@ -228,9 +228,6 @@ struct eigrp_iface { }; RB_PROTOTYPE(iface_id_head, eigrp_iface, id_tree, iface_id_compare) -#define INADDRSZ 4 -#define IN6ADDRSZ 16 - struct seq_addr_entry { TAILQ_ENTRY(seq_addr_entry) entry; int af; diff --git a/usr.sbin/eigrpd/tlv.c b/usr.sbin/eigrpd/tlv.c index 3e64c5317e9..6715a8f4061 100644 --- a/usr.sbin/eigrpd/tlv.c +++ b/usr.sbin/eigrpd/tlv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlv.c,v 1.15 2016/10/10 02:26:24 gsoares Exp $ */ +/* $OpenBSD: tlv.c,v 1.16 2021/11/03 13:48:46 deraadt Exp $ */ /* * Copyright (c) 2015 Renato Westphal @@ -66,10 +66,10 @@ gen_sequence_tlv(struct ibuf *buf, struct seq_addr_head *seq_addr_list) TAILQ_FOREACH(sa, seq_addr_list, entry) { switch (sa->af) { case AF_INET: - alen = INADDRSZ; + alen = sizeof (struct in_addr); break; case AF_INET6: - alen = IN6ADDRSZ; + alen = sizeof(struct in6_addr); break; default: fatalx("gen_sequence_tlv: unknown address family"); @@ -298,14 +298,14 @@ tlv_decode_seq(int af, struct tlv *tlv, char *buf, switch (af) { case AF_INET: - if (alen != INADDRSZ) { + if (alen != sizeof (struct in_addr)) { log_debug("%s: invalid address length", __func__); return (-1); } break; case AF_INET6: - if (alen != IN6ADDRSZ) { + if (alen != sizeof (struct in6_addr)) { log_debug("%s: invalid address length", __func__); return (-1); -- 2.20.1