Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177589084
D19490.1794805673.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D19490.1794805673.diff
View Options
Index: sys/net/if_arp.h
===================================================================
--- sys/net/if_arp.h
+++ sys/net/if_arp.h
@@ -101,12 +101,14 @@
struct arpstat {
/* Normal things that happen: */
uint64_t txrequests; /* # of ARP requests sent by this host. */
+ uint64_t txerrors; /* # of ARP requests failed to send. */
uint64_t txreplies; /* # of ARP replies sent by this host. */
+
uint64_t rxrequests; /* # of ARP requests received by this host. */
uint64_t rxreplies; /* # of ARP replies received by this host. */
uint64_t received; /* # of ARP packets received by this host. */
- uint64_t arp_spares[4]; /* For either the upper or lower half. */
+ uint64_t arp_spares[3]; /* For either the upper or lower half. */
/* Abnormal event and error counting: */
uint64_t dropped; /* # of packets dropped waiting for a reply. */
uint64_t timeouts; /* # of times with entries removed */
Index: sys/netinet/if_ether.c
===================================================================
--- sys/netinet/if_ether.c
+++ sys/netinet/if_ether.c
@@ -161,8 +161,15 @@
"Number of times to retransmit GARP packets;"
" 0 to disable, maximum of 16");
+VNET_DEFINE_STATIC(int, arp_log_level) = LOG_INFO; /* Min. log(9) level. */
+#define V_arp_log_level VNET(arp_log_level)
+SYSCTL_INT(_net_link_ether_arp, OID_AUTO, log_level, CTLFLAG_VNET | CTLFLAG_RW,
+ &VNET_NAME(arp_log_level), 0,
+ "Minimum log(9) level for recording rate limited arp log messages. "
+ "The higher will be log more (emerg=0, info=6 (default), debug=7).");
#define ARP_LOG(pri, ...) do { \
- if (ppsratecheck(&arp_lastlog, &arp_curpps, arp_maxpps)) \
+ if ((pri) <= V_arp_log_level && \
+ ppsratecheck(&arp_lastlog, &arp_curpps, arp_maxpps)) \
log((pri), "arp: " __VA_ARGS__); \
} while (0)
@@ -428,9 +435,11 @@
m_clrprotoflags(m); /* Avoid confusing lower layers. */
error = (*ifp->if_output)(ifp, m, &sa, &ro);
ARPSTAT_INC(txrequests);
- if (error)
+ if (error) {
+ ARPSTAT_INC(txerrors);
ARP_LOG(LOG_DEBUG, "Failed to send ARP packet on %s: %d\n",
if_name(ifp), error);
+ }
return (error);
}
Index: usr.bin/netstat/inet.c
===================================================================
--- usr.bin/netstat/inet.c
+++ usr.bin/netstat/inet.c
@@ -1044,6 +1044,7 @@
xo_emit("\t" m, (uintmax_t)arpstat.f, pluralies(arpstat.f))
p(txrequests, "{:sent-requests/%ju} {N:/ARP request%s sent}\n");
+ p(txerrors, "{:sent-failures/%ju} {N:/ARP request%s failed to sent}\n");
p2(txreplies, "{:sent-replies/%ju} {N:/ARP repl%s sent}\n");
p(rxrequests, "{:received-requests/%ju} "
"{N:/ARP request%s received}\n");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 16, 5:07 AM (6 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41761573
Default Alt Text
D19490.1794805673.diff (2 KB)
Attached To
Mode
D19490: Improve ARP logging
Attached
Detach File
Event Timeline