summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_athn_usb.c
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2015-03-02 15:18:38 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2015-03-02 15:18:38 +0000
commit97ed77d7a9f1a4c010969f74a3ced52aa6853838 (patch)
tree5540267e20ca7773257ec0da345897057ba1ff2f /sys/dev/usb/if_athn_usb.c
parent8a04477f46e2a054483dfa73a76e8d95fe3110fc (diff)
athn(4) USB drops received frames larger than MCLBYTES.
Count these dropped frames as input errors.
Diffstat (limited to 'sys/dev/usb/if_athn_usb.c')
-rw-r--r--sys/dev/usb/if_athn_usb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c
index cd55b8cfde5..bb4e6eca457 100644
--- a/sys/dev/usb/if_athn_usb.c
+++ b/sys/dev/usb/if_athn_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_athn_usb.c,v 1.31 2015/03/02 15:05:11 stsp Exp $ */
+/* $OpenBSD: if_athn_usb.c,v 1.32 2015/03/02 15:18:37 stsp Exp $ */
/*-
* Copyright (c) 2011 Damien Bergamini <damien.bergamini@free.fr>
@@ -1804,6 +1804,8 @@ athn_usb_rxeof(struct usbd_xfer *xfer, void *priv,
{
struct athn_usb_rx_data *data = priv;
struct athn_usb_softc *usc = data->sc;
+ struct athn_softc *sc = &usc->sc_sc;
+ struct ifnet *ifp = &sc->sc_ic.ic_if;
struct athn_usb_rx_stream *stream = &usc->rx_stream;
uint8_t *buf = data->buf;
struct ar_stream_hdr *hdr;
@@ -1872,6 +1874,10 @@ athn_usb_rxeof(struct usbd_xfer *xfer, void *priv,
}
} else /* Drop frames larger than MCLBYTES. */
m = NULL;
+
+ if (m == NULL)
+ ifp->if_ierrors++;
+
/*
* NB: m can be NULL, in which case the next pktlen bytes
* will be discarded from the Rx stream.