tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Let's not count unknown ethertypes as interface errors?



Hey folks,

since I am (still) struggling with wlan stuff I may look more often at
error counters than others - or have you ever noticed that the wifi
device in your NetBSD notebook shows tons of (and ever increasing)
error counts?

E.g. on this machine:

 > ifconfig -v athn0 | fgrep input
        input: 2343 packets, 186818 bytes, 479 multicasts, 258 errors

and it will steadily increase while I keep typing over that connection.

This is a very normal condition and no actual errors involved - I am using
wpa_supplicant and this causes 802.1x frames to be sent/received.
Now our kernel does not do anything with them, but here:

	https://nxr.netbsd.org/xref/src/sys/net/if_ethersubr.c#928

it drops the packet, frees the mbuf chain, but also:

    951 drop:
    952 	m_freem(m);
    953 dropped:
    954 	if_statinc(ifp, if_ierrors); /* XXX should have a dedicated counter? */

increments the input error count - and I think that is wrong, as the XXX
comment hints.

Several easy solutions:
 - like the comment says: create a special "unknown protocols" counter
   and use that for this case, leaving the other "goto drop;" in that
   function still increase ierrors
 - just delete the last line (if_statinc) here - no real error to be seen,
   just ignore it silentely
 - as above, but conditionalize it on some net.$whatever debug sysctl
   setting

I would go for the most easy way (2nd suggestion, just delete it).

What do you think?

Martin
P.S.: after being done with this message, my counter now says:
        input: 8766 packets, 1079266 bytes, 1388 multicasts, 737 errors



Home | Main Index | Thread Index | Old Index