From 04cb3f44b439b3ffec96eb4fd8a1c482f300c58b Mon Sep 17 00:00:00 2001 From: bluhm Date: Fri, 23 Apr 2021 21:47:32 +0000 Subject: [PATCH] The variable la_hold_total contains the number of packets currently in the arp queue. So the sysctl net.inet.ip.arpqueued must be read only. In if_ether.c include the header with the declaration of la_hold_total to ensure that the definition matches. OK mvs@ --- sys/netinet/if_ether.c | 3 ++- sys/netinet/ip_input.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index fceeffc3e10..710f7d58492 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.243 2020/06/24 22:03:43 cheloha Exp $ */ +/* $OpenBSD: if_ether.c,v 1.244 2021/04/23 21:47:32 bluhm Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -60,6 +60,7 @@ #include #include #include +#include #if NCARP > 0 #include #endif diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index e5b74e4cb5f..69d5646088b 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.356 2021/03/30 08:37:10 sashan Exp $ */ +/* $OpenBSD: ip_input.c,v 1.357 2021/04/23 21:47:32 bluhm Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -126,7 +126,6 @@ const struct sysctl_bounded_args ipctl_vars[] = { { IPCTL_IPPORT_MAXQUEUE, &ip_maxqueue, 0, 10000 }, { IPCTL_MFORWARDING, &ipmforwarding, 0, 1 }, { IPCTL_MULTIPATH, &ipmultipath, 0, 1 }, - { IPCTL_ARPQUEUED, &la_hold_total, 0, 1000 }, { IPCTL_ARPTIMEOUT, &arpt_keep, 0, INT_MAX }, { IPCTL_ARPDOWN, &arpt_down, 0, INT_MAX }, }; @@ -1643,6 +1642,8 @@ ip_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, case IPCTL_ARPQUEUE: return (sysctl_niq(name + 1, namelen - 1, oldp, oldlenp, newp, newlen, &arpinq)); + case IPCTL_ARPQUEUED: + return (sysctl_rdint(oldp, oldlenp, newp, la_hold_total)); case IPCTL_STATS: return (ip_sysctl_ipstat(oldp, oldlenp, newp)); #ifdef MROUTING -- 2.20.1