diff options
author | 2015-07-16 00:24:26 +0000 | |
---|---|---|
committer | 2015-07-16 00:24:26 +0000 | |
commit | ad7625d1c88e24b4a8d9a3f37343a21ae717055b (patch) | |
tree | 6e8b6ade5aeed0626af625fe3b06320c2fea19a0 | |
parent | fix recv packet header definiton (diff) | |
download | wireguard-openbsd-ad7625d1c88e24b4a8d9a3f37343a21ae717055b.tar.xz wireguard-openbsd-ad7625d1c88e24b4a8d9a3f37343a21ae717055b.zip |
ignore 4 byte trailing padding of each recv packet, when copying to upper
layer.
-rw-r--r-- | sys/dev/usb/if_axen.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/if_axen.c b/sys/dev/usb/if_axen.c index 18fabf24945..82698a330db 100644 --- a/sys/dev/usb/if_axen.c +++ b/sys/dev/usb/if_axen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axen.c,v 1.14 2015/06/24 09:40:54 mpi Exp $ */ +/* $OpenBSD: if_axen.c,v 1.15 2015/07/16 00:24:26 yuo Exp $ */ /* * Copyright (c) 2013 Yojiro UO <yuo@openbsd.org> @@ -1035,8 +1035,8 @@ axen_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status) goto nextpkt; } - /* skip pseudo header (2byte) */ - m->m_pkthdr.len = m->m_len = pkt_len - 2; + /* skip pseudo header (2byte) and trailer padding (4Byte) */ + m->m_pkthdr.len = m->m_len = pkt_len - 6; #ifdef AXEN_TOE /* cheksum err */ @@ -1058,7 +1058,7 @@ axen_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status) M_UDP_CSUM_IN_OK; #endif - memcpy(mtod(m, char *), buf + 2, pkt_len - 2); + memcpy(mtod(m, char *), buf + 2, pkt_len - 6); ml_enqueue(&ml, m); |