summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortdeval <tdeval@openbsd.org>2002-12-13 22:40:16 +0000
committertdeval <tdeval@openbsd.org>2002-12-13 22:40:16 +0000
commit9902da4fd68ac9e603c86a837ea105638be1a1db (patch)
treefe3f8de6667df48cb0ffc96905d6a76adeb39fd2
parentCast to unsigned int, not unsigned char, since what is being cast is an (diff)
downloadwireguard-openbsd-9902da4fd68ac9e603c86a837ea105638be1a1db.tar.xz
wireguard-openbsd-9902da4fd68ac9e603c86a837ea105638be1a1db.zip
Only WRITE_REQUEST_DATABLOCK are limited to the device's max_receive.
Other writes are only limited by the link speed. Idea from NetBSD.
-rw-r--r--sys/dev/ieee1394/fwohci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ieee1394/fwohci.c b/sys/dev/ieee1394/fwohci.c
index ca73df18e61..1606006f32c 100644
--- a/sys/dev/ieee1394/fwohci.c
+++ b/sys/dev/ieee1394/fwohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fwohci.c,v 1.6 2002/12/13 21:35:11 tdeval Exp $ */
+/* $OpenBSD: fwohci.c,v 1.7 2002/12/13 22:40:16 tdeval Exp $ */
/* $NetBSD: fwohci.c,v 1.54 2002/03/29 05:06:42 jmc Exp $ */
/*
@@ -3821,7 +3821,9 @@ fwohci_write(struct ieee1394_abuf *ab)
u_int32_t high, lo;
int rv;
- if (ab->ab_length > IEEE1394_MAX_REC(sc->sc1394_max_receive)) {
+ if ((ab->ab_tcode == IEEE1394_TCODE_WRITE_REQUEST_DATABLOCK &&
+ ab->ab_length > IEEE1394_MAX_REC(sc->sc1394_max_receive)) ||
+ ab->ab_length > IEEE1394_MAX_ASYNC(sc->sc1394_link_speed)) {
DPRINTF(("%s: Packet too large: %d\n", __func__,
ab->ab_length));
return E2BIG;