summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2016-10-30 17:32:01 +0100
committerBen Hutchings <ben@decadent.org.uk>2017-02-23 03:54:28 +0000
commitf31d4542bf1aa7c7c902cb9066fb37d4e8d9e3b6 (patch)
tree8eedef3f6a7b676ea76f20ebd650d2192f681561 /drivers/hid
parent176ae6407856cfeb30a03a904e7543987c473f74 (diff)
downloadlinux-stable-f31d4542bf1aa7c7c902cb9066fb37d4e8d9e3b6.tar.gz
linux-stable-f31d4542bf1aa7c7c902cb9066fb37d4e8d9e3b6.tar.bz2
linux-stable-f31d4542bf1aa7c7c902cb9066fb37d4e8d9e3b6.zip
firewire: net: fix fragmented datagram_size off-by-one
commit e9300a4b7bbae83af1f7703938c94cf6dc6d308f upstream. RFC 2734 defines the datagram_size field in fragment encapsulation headers thus: datagram_size: The encoded size of the entire IP datagram. The value of datagram_size [...] SHALL be one less than the value of Total Length in the datagram's IP header (see STD 5, RFC 791). Accordingly, the eth1394 driver of Linux 2.6.36 and older set and got this field with a -/+1 offset: ether1394_tx() /* transmit */ ether1394_encapsulate_prep() hdr->ff.dg_size = dg_size - 1; ether1394_data_handler() /* receive */ if (hdr->common.lf == ETH1394_HDR_LF_FF) dg_size = hdr->ff.dg_size + 1; else dg_size = hdr->sf.dg_size + 1; Likewise, I observe OS X 10.4 and Windows XP Pro SP3 to transmit 1500 byte sized datagrams in fragments with datagram_size=1499 if link fragmentation is required. Only firewire-net sets and gets datagram_size without this offset. The result is lacking interoperability of firewire-net with OS X, Windows XP, and presumably Linux' eth1394. (I did not test with the latter.) For example, FTP data transfers to a Linux firewire-net box with max_rec smaller than the 1500 bytes MTU - from OS X fail entirely, - from Win XP start out with a bunch of fragmented datagrams which time out, then continue with unfragmented datagrams because Win XP temporarily reduces the MTU to 576 bytes. So let's fix firewire-net's datagram_size accessors. Note that firewire-net thereby loses interoperability with unpatched firewire-net, but only if link fragmentation is employed. (This happens with large broadcast datagrams, and with large datagrams on several FireWire CardBus cards with smaller max_rec than equivalent PCI cards, and it can be worked around by setting a small enough MTU.) Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/hid')
0 files changed, 0 insertions, 0 deletions