fragmentation.c (248e23b50e2da0753f3b5faa068939cbe9f8a75a) | fragmentation.c (51c6b429c0c95e67edd1cb0b548c5cf6a6604763) |
---|---|
1/* Copyright (C) 2013-2016 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 * --- 487 unchanged lines hidden (view full) --- 496 if (skb->priority >= 256 && skb->priority <= 263) 497 frag_header.priority = skb->priority - 256; 498 499 ether_addr_copy(frag_header.orig, primary_if->net_dev->dev_addr); 500 ether_addr_copy(frag_header.dest, orig_node->orig); 501 502 /* Eat and send fragments from the tail of skb */ 503 while (skb->len > max_fragment_size) { | 1/* Copyright (C) 2013-2016 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 * --- 487 unchanged lines hidden (view full) --- 496 if (skb->priority >= 256 && skb->priority <= 263) 497 frag_header.priority = skb->priority - 256; 498 499 ether_addr_copy(frag_header.orig, primary_if->net_dev->dev_addr); 500 ether_addr_copy(frag_header.dest, orig_node->orig); 501 502 /* Eat and send fragments from the tail of skb */ 503 while (skb->len > max_fragment_size) { |
504 /* The initial check in this function should cover this case */ 505 if (unlikely(frag_header.no == BATADV_FRAG_MAX_FRAGMENTS - 1)) { 506 ret = -EINVAL; 507 goto put_primary_if; 508 } 509 |
|
504 skb_fragment = batadv_frag_create(skb, &frag_header, mtu); 505 if (!skb_fragment) { 506 ret = -ENOMEM; 507 goto put_primary_if; 508 } 509 510 batadv_inc_counter(bat_priv, BATADV_CNT_FRAG_TX); 511 batadv_add_counter(bat_priv, BATADV_CNT_FRAG_TX_BYTES, 512 skb_fragment->len + ETH_HLEN); 513 ret = batadv_send_unicast_skb(skb_fragment, neigh_node); 514 if (ret != NET_XMIT_SUCCESS) { 515 ret = NET_XMIT_DROP; 516 goto put_primary_if; 517 } 518 519 frag_header.no++; | 510 skb_fragment = batadv_frag_create(skb, &frag_header, mtu); 511 if (!skb_fragment) { 512 ret = -ENOMEM; 513 goto put_primary_if; 514 } 515 516 batadv_inc_counter(bat_priv, BATADV_CNT_FRAG_TX); 517 batadv_add_counter(bat_priv, BATADV_CNT_FRAG_TX_BYTES, 518 skb_fragment->len + ETH_HLEN); 519 ret = batadv_send_unicast_skb(skb_fragment, neigh_node); 520 if (ret != NET_XMIT_SUCCESS) { 521 ret = NET_XMIT_DROP; 522 goto put_primary_if; 523 } 524 525 frag_header.no++; |
520 521 /* The initial check in this function should cover this case */ 522 if (frag_header.no == BATADV_FRAG_MAX_FRAGMENTS - 1) { 523 ret = -EINVAL; 524 goto put_primary_if; 525 } | |
526 } 527 528 /* Make room for the fragment header. */ 529 if (batadv_skb_head_push(skb, header_size) < 0 || 530 pskb_expand_head(skb, header_size + ETH_HLEN, 0, GFP_ATOMIC) < 0) { 531 ret = -ENOMEM; 532 goto put_primary_if; 533 } --- 18 unchanged lines hidden --- | 526 } 527 528 /* Make room for the fragment header. */ 529 if (batadv_skb_head_push(skb, header_size) < 0 || 530 pskb_expand_head(skb, header_size + ETH_HLEN, 0, GFP_ATOMIC) < 0) { 531 ret = -ENOMEM; 532 goto put_primary_if; 533 } --- 18 unchanged lines hidden --- |