aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2016-10-23 10:29:03 -0400
committerDavid S. Miller <davem@davemloft.net>2016-10-26 17:28:50 -0400
commit5d48f00d836a628c695c6e3f96881d73641f6a2f (patch)
treed07a89e6ba1d5086fbdc60ab4476fcf5186c58b1 /drivers/firewire
parente2897b8238ab8fdee067cfe472dd52a3414d5716 (diff)
firewire: net: fix maximum possible MTU
Commit b3e3893e1253 ("net: use core MTU range checking in misc drivers") mistakenly introduced an upper limit for firewire-net's MTU based on the local link layer controller's reception capability. Revert this. Neither RFC 2734 nor our implementation impose any particular upper limit. Actually, to be on the safe side and to make the code explicit, set ETH_MAX_MTU = 65535 as upper limit now. (I replaced sizeof(struct rfc2734_header) by the equivalent RFC2374_FRAG_HDR_SIZE in order to avoid distracting long/int conversions.) Fixes: b3e3893e1253('net: use core MTU range checking in misc drivers') CC: netdev@vger.kernel.org CC: linux1394-devel@lists.sourceforge.net CC: Jarod Wilson <jarod@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/net.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 8430222151fc..99379542b263 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -1467,10 +1467,11 @@ static int fwnet_probe(struct fw_unit *unit,
1467 * Use the RFC 2734 default 1500 octets or the maximum payload 1467 * Use the RFC 2734 default 1500 octets or the maximum payload
1468 * as initial MTU 1468 * as initial MTU
1469 */ 1469 */
1470 net->max_mtu = (1 << (card->max_receive + 1)) 1470 net->mtu = min(1500U,
1471 - sizeof(struct rfc2734_header) - IEEE1394_GASP_HDR_SIZE; 1471 (1U << (card->max_receive + 1))
1472 net->mtu = min(1500U, net->max_mtu); 1472 - RFC2374_FRAG_HDR_SIZE - IEEE1394_GASP_HDR_SIZE);
1473 net->min_mtu = ETH_MIN_MTU; 1473 net->min_mtu = ETH_MIN_MTU;
1474 net->max_mtu = ETH_MAX_MTU;
1474 1475
1475 /* Set our hardware address while we're at it */ 1476 /* Set our hardware address while we're at it */
1476 ha = (union fwnet_hwaddr *)net->dev_addr; 1477 ha = (union fwnet_hwaddr *)net->dev_addr;