Page MenuHomeFreeBSD

Improve ARP logging

Authored by bz on Mar 7 2019, 12:24 AM.



r344504 added an extra ARP_LOG() call in case of an if_output() failure. It turns out IPv4 (especially when dhclient is running) can be noisy. In order to not spam the console by default: (a) add a counter for these events so people can keep better track of how often it happens, and (b) add a sysctl to select the default ARP_LOG log level and set it to INFO avoiding the one (the new) DEBUG level by default.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Should add: X-MFC: never.

106 ↗(On Diff #54793)

I added the extra white line in order to also separate tx from rx counters. I can remove it if people feel it is noise.

104 ↗(On Diff #54793)

Putting txerrors here shifts the elements between it and arp_spares. That presumably breaks compatibility even though the size of the structure does not change. Does netstat print any of these?

104 ↗(On Diff #54793)

Yes, netstat does print these (netstat -s -p arp), see change below.

I can play nice and not break netstat inside HEAD (no MFC planned) and have rx and tx counters intermixed in the structure if that will help for 12->13 upgrades (where we don't guarantee stability but still try to play nice). Should I?

Re-sort the struct fields to not change the expected order and use a spare field in-place. That will help netstat to continue working when updating from 12->13 without shuffling the values around.

bz marked an inline comment as done.Mar 7 2019, 11:18 PM

This seems good to me. If this is not to be MFC'd, compatibility wouldn't matter (in which case I wouldn't have reduced the number of spares). It's nice to have things in order, but maybe this isn't the time to break compatibility given the small scope.

This revision is now accepted and ready to land.Mar 7 2019, 11:46 PM
This revision was automatically updated to reflect the committed changes.