Currently lagg double-counts errors from lagg members, and counts drops from members as errors. Eg, if lagg sends a packet, and the underlying hardware driver drops it, that will increment a counter in both the underlying driver, and in lagg. The problem is that lagg also adds errors / drops from underlying drivers to its counts, so the same packet will increment IFCOUNTER_OERRORS twice (once for the underlying driver, once for the error returned from the underlying driver via lagg_proto_start(), or will increment IFCOUNTER_OQDROP *and* IFCOUNTER_OERRORS for the same dropped packet.
Consider the following output from netstat -ndi (filtered for clarity):
Name Mtu Network Address Ipkts Ierrs Idrop Opkts Oerrs Coll Drop mce0 1500 <Link#4> 98:03:9b:67:c3:d2 14981407225 0 0 100879042527 0 0 1839680 mce2 1500 <Link#6> 98:03:9b:67:c3:d2 15023021203 0 0 100963275792 0 0 1522150 lagg0 1500 <Link#8> 98:03:9b:67:c3:d2 30004428429 0 0 201842318320 3361846 0 3361830
In this case, the underlying ports have dropped 3361830 packets as output drops. Lagg has counted them towards its output errors (along with 16 output errors at the lagg level). The lagg0 line above should look like:
lagg0 1500 <Link#8> 98:03:9b:67:c3:d2 30004428429 0 0 201842318320 16 0 3361830
This change attempts to fix that by incrementing lagg's counters only for errors that do not come from underlying drivers.