fragmentation.c (e23c34bb41da65f354fb7eee04300c56ee48f60c) | fragmentation.c (a40d9b075c21f06872de3f05cc2eb3d06665e2ff) |
---|---|
1/* Copyright (C) 2013 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 * --- 341 unchanged lines hidden (view full) --- 350 * be assembled. 351 */ 352 total_size = ntohs(packet->total_size); 353 if (total_size > neigh_node->if_incoming->net_dev->mtu) { 354 batadv_inc_counter(bat_priv, BATADV_CNT_FRAG_FWD); 355 batadv_add_counter(bat_priv, BATADV_CNT_FRAG_FWD_BYTES, 356 skb->len + ETH_HLEN); 357 | 1/* Copyright (C) 2013 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 * --- 341 unchanged lines hidden (view full) --- 350 * be assembled. 351 */ 352 total_size = ntohs(packet->total_size); 353 if (total_size > neigh_node->if_incoming->net_dev->mtu) { 354 batadv_inc_counter(bat_priv, BATADV_CNT_FRAG_FWD); 355 batadv_add_counter(bat_priv, BATADV_CNT_FRAG_FWD_BYTES, 356 skb->len + ETH_HLEN); 357 |
358 packet->header.ttl--; | 358 packet->ttl--; |
359 batadv_send_skb_packet(skb, neigh_node->if_incoming, 360 neigh_node->addr); 361 ret = true; 362 } 363 364out: 365 if (orig_node_dst) 366 batadv_orig_node_free_ref(orig_node_dst); --- 72 unchanged lines hidden (view full) --- 439 goto out_err; 440 441 bat_priv = orig_node->bat_priv; 442 primary_if = batadv_primary_if_get_selected(bat_priv); 443 if (!primary_if) 444 goto out_err; 445 446 /* Create one header to be copied to all fragments */ | 359 batadv_send_skb_packet(skb, neigh_node->if_incoming, 360 neigh_node->addr); 361 ret = true; 362 } 363 364out: 365 if (orig_node_dst) 366 batadv_orig_node_free_ref(orig_node_dst); --- 72 unchanged lines hidden (view full) --- 439 goto out_err; 440 441 bat_priv = orig_node->bat_priv; 442 primary_if = batadv_primary_if_get_selected(bat_priv); 443 if (!primary_if) 444 goto out_err; 445 446 /* Create one header to be copied to all fragments */ |
447 frag_header.header.packet_type = BATADV_UNICAST_FRAG; 448 frag_header.header.version = BATADV_COMPAT_VERSION; 449 frag_header.header.ttl = BATADV_TTL; | 447 frag_header.packet_type = BATADV_UNICAST_FRAG; 448 frag_header.version = BATADV_COMPAT_VERSION; 449 frag_header.ttl = BATADV_TTL; |
450 frag_header.seqno = htons(atomic_inc_return(&bat_priv->frag_seqno)); 451 frag_header.reserved = 0; 452 frag_header.no = 0; 453 frag_header.total_size = htons(skb->len); 454 memcpy(frag_header.orig, primary_if->net_dev->dev_addr, ETH_ALEN); 455 memcpy(frag_header.dest, orig_node->orig, ETH_ALEN); 456 457 /* Eat and send fragments from the tail of skb */ --- 34 unchanged lines hidden --- | 450 frag_header.seqno = htons(atomic_inc_return(&bat_priv->frag_seqno)); 451 frag_header.reserved = 0; 452 frag_header.no = 0; 453 frag_header.total_size = htons(skb->len); 454 memcpy(frag_header.orig, primary_if->net_dev->dev_addr, ETH_ALEN); 455 memcpy(frag_header.dest, orig_node->orig, ETH_ALEN); 456 457 /* Eat and send fragments from the tail of skb */ --- 34 unchanged lines hidden --- |