From b762991ec12e9c680d393b790008383903a39132 Mon Sep 17 00:00:00 2001 From: Florian Obser Date: Sat, 13 Oct 2018 18:36:02 +0000 Subject: Expose net.inet.ip.arpq.drops to help debug what's going on when a lot of packets are being dropped but non of the other counters are increasing. From Daniel Hokka Zakrisson (daniel AT hozac DOT com), thanks! OK florian, phessler --- sys/netinet/in.h | 7 +++++-- sys/netinet/ip_input.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 5f7fb9e8a8c..5190efc0206 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in.h,v 1.132 2018/09/11 21:04:03 bluhm Exp $ */ +/* $OpenBSD: in.h,v 1.133 2018/10/13 18:36:01 florian Exp $ */ /* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */ /* @@ -688,7 +688,8 @@ struct ip_mreq { #define IPCTL_MRTVIF 38 #define IPCTL_ARPTIMEOUT 39 #define IPCTL_ARPDOWN 40 -#define IPCTL_MAXID 41 +#define IPCTL_ARPQUEUE 41 +#define IPCTL_MAXID 42 #define IPCTL_NAMES { \ { 0, 0 }, \ @@ -732,6 +733,7 @@ struct ip_mreq { { "mrtvif", CTLTYPE_STRUCT }, \ { "arptimeout", CTLTYPE_INT }, \ { "arpdown", CTLTYPE_INT }, \ + { "arpq", CTLTYPE_NODE }, \ } #define IPCTL_VARS { \ NULL, \ @@ -775,6 +777,7 @@ struct ip_mreq { NULL, \ &arpt_keep, \ &arpt_down, \ + NULL, \ } #endif /* __BSD_VISIBLE */ diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index ced863c761a..30e7a2c71eb 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.341 2018/09/11 21:04:03 bluhm Exp $ */ +/* $OpenBSD: ip_input.c,v 1.342 2018/10/13 18:36:01 florian Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -120,6 +120,8 @@ int ip_sysctl_ipstat(void *, size_t *, void *); static struct mbuf_queue ipsend_mq; +extern struct niqueue arpinq; + int ip_ours(struct mbuf **, int *, int, int); int ip_local(struct mbuf **, int *, int, int); int ip_dooptions(struct mbuf *, struct ifnet *); @@ -1579,7 +1581,8 @@ ip_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, #endif /* Almost all sysctl names at this level are terminal. */ - if (namelen != 1 && name[0] != IPCTL_IFQUEUE) + if (namelen != 1 && name[0] != IPCTL_IFQUEUE && + name[0] != IPCTL_ARPQUEUE) return (ENOTDIR); switch (name[0]) { @@ -1639,6 +1642,9 @@ ip_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, case IPCTL_IFQUEUE: return (sysctl_niq(name + 1, namelen - 1, oldp, oldlenp, newp, newlen, &ipintrq)); + case IPCTL_ARPQUEUE: + return (sysctl_niq(name + 1, namelen - 1, + oldp, oldlenp, newp, newlen, &arpinq)); case IPCTL_STATS: return (ip_sysctl_ipstat(oldp, oldlenp, newp)); #ifdef MROUTING -- cgit v1.2.3