Apparently some athn(4) variants are buggy and may hand us corrupted
packets.  Linux has some workarounds for this and the diff below is a
(partial) addaptation of those workarounds.  It seems the idea is that
the error bits in the status word should not be set even if the frame
is marked as ok.  So if those bits are set, ignore the frame and bump
the input error count.  This doesn't filter out all corrupted frames,
but it does seem to drop most of them and seems to prevent filling up
the node cache on my access point that uses athn(4):

athn0 at pci1 dev 0 function 0 "Atheros AR9281" rev 0x01: intx
athn0: AR9280 rev 2 (2T2R), ROM rev 16, address xx:xx:xx:xx:xx:xx

ok?


Index: dev/ic/ar5008.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/ar5008.c,v
retrieving revision 1.67
diff -u -p -r1.67 ar5008.c
--- dev/ic/ar5008.c     1 Jul 2021 11:51:55 -0000       1.67
+++ dev/ic/ar5008.c     3 Oct 2021 19:21:11 -0000
@@ -921,6 +921,12 @@ ar5008_rx_process(struct athn_softc *sc,
                        ifp->if_ierrors++;
                        goto skip;
                }
+       } else {
+               if (ds->ds_status8 & (AR_RXS8_CRC_ERR | AR_RXS8_PHY_ERR |
+                   AR_RXS8_DECRYPT_CRC_ERR | AR_RXS8_MICHAEL_ERR)) {
+                       ifp->if_ierrors++;
+                       goto skip;
+               }
        }
 
        len = MS(ds->ds_status1, AR_RXS1_DATA_LEN);

Reply via email to