fragmentation.c (5b6698b0e4a37053de35cc24ee695b98a7eb712b) fragmentation.c (0402e444cd199389b7fe47be68a67b817e09e097)
1/* Copyright (C) 2013-2014 B.A.T.M.A.N. contributors:
2 *
3 * Martin Hundebøll <martin@hundeboll.net>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public
7 * License as published by the Free Software Foundation.
8 *

--- 420 unchanged lines hidden (view full) ---

429 unsigned header_size = sizeof(frag_header);
430 unsigned max_fragment_size, max_packet_size;
431 bool ret = false;
432
433 /* To avoid merge and refragmentation at next-hops we never send
434 * fragments larger than BATADV_FRAG_MAX_FRAG_SIZE
435 */
436 mtu = min_t(unsigned, mtu, BATADV_FRAG_MAX_FRAG_SIZE);
1/* Copyright (C) 2013-2014 B.A.T.M.A.N. contributors:
2 *
3 * Martin Hundebøll <martin@hundeboll.net>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public
7 * License as published by the Free Software Foundation.
8 *

--- 420 unchanged lines hidden (view full) ---

429 unsigned header_size = sizeof(frag_header);
430 unsigned max_fragment_size, max_packet_size;
431 bool ret = false;
432
433 /* To avoid merge and refragmentation at next-hops we never send
434 * fragments larger than BATADV_FRAG_MAX_FRAG_SIZE
435 */
436 mtu = min_t(unsigned, mtu, BATADV_FRAG_MAX_FRAG_SIZE);
437 max_fragment_size = (mtu - header_size - ETH_HLEN);
437 max_fragment_size = mtu - header_size;
438 max_packet_size = max_fragment_size * BATADV_FRAG_MAX_FRAGMENTS;
439
440 /* Don't even try to fragment, if we need more than 16 fragments */
441 if (skb->len > max_packet_size)
442 goto out_err;
443
444 bat_priv = orig_node->bat_priv;
445 primary_if = batadv_primary_if_get_selected(bat_priv);

--- 53 unchanged lines hidden ---
438 max_packet_size = max_fragment_size * BATADV_FRAG_MAX_FRAGMENTS;
439
440 /* Don't even try to fragment, if we need more than 16 fragments */
441 if (skb->len > max_packet_size)
442 goto out_err;
443
444 bat_priv = orig_node->bat_priv;
445 primary_if = batadv_primary_if_get_selected(bat_priv);

--- 53 unchanged lines hidden ---