summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_umb.c
diff options
context:
space:
mode:
authorgerhard <gerhard@openbsd.org>2016-11-14 12:55:56 +0000
committergerhard <gerhard@openbsd.org>2016-11-14 12:55:56 +0000
commit5bf799d0b904844a30801db259c6dfce362d59d7 (patch)
tree5e192ac35d22c42dfc5dfc5ed097908fba459320 /sys/dev/usb/if_umb.c
parentReflect interface priorities when inserting RTF_CONNECTED routes. (diff)
downloadwireguard-openbsd-5bf799d0b904844a30801db259c6dfce362d59d7.tar.xz
wireguard-openbsd-5bf799d0b904844a30801db259c6dfce362d59d7.zip
Stop looking for further NCM datagrams if either length or offset of
the next datagram is zero. Tested by otto@ ok mpi@ kettnis@ otto@
Diffstat (limited to 'sys/dev/usb/if_umb.c')
-rw-r--r--sys/dev/usb/if_umb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/if_umb.c b/sys/dev/usb/if_umb.c
index 11f3fe43b47..82f189e6431 100644
--- a/sys/dev/usb/if_umb.c
+++ b/sys/dev/usb/if_umb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_umb.c,v 1.5 2016/11/10 14:45:43 gerhard Exp $ */
+/* $OpenBSD: if_umb.c,v 1.6 2016/11/14 12:55:56 gerhard Exp $ */
/*
* Copyright (c) 2016 genua mbH
@@ -1815,7 +1815,7 @@ umb_decap(struct umb_softc *sc, struct usbd_xfer *xfer)
}
/* Terminating zero entry */
- if (dlen == 0 && doff == 0)
+ if (dlen == 0 || doff == 0)
break;
if (len < dlen + doff) {
/* Skip giant datagram but continue processing */