40 int hdr_len =
sizeof(*unicast_packet);
41 int uni_diff =
sizeof(*up) -
hdr_len;
53 if (skb_linearize(skb) < 0 || skb_linearize(tmp_skb) < 0)
63 list_move_tail(&tfp->
list, head);
69 packet_pos =
skb_pull(skb, uni_diff);
81 static void batadv_frag_create_entry(
struct list_head *head,
95 list_move(&tfp->
list, head);
99 static int batadv_frag_create_buffer(
struct list_head *head)
112 INIT_LIST_HEAD(&tfp->
list);
113 list_add(&tfp->
list, head);
120 batadv_frag_search_packet(
struct list_head *head,
125 int is_head_tmp, is_head;
145 if (tfp->
seqno == search_seqno) {
147 if (is_head_tmp != is_head)
156 list_move_tail(&tfp->
list, head);
164 if (!list_empty(head)) {
193 orig_node = batadv_orig_hash_find(bat_priv, unicast_packet->
orig);
200 batadv_frag_create_buffer(&orig_node->
frag_list)) {
201 pr_debug(
"couldn't create frag buffer\n");
205 tmp_frag_entry = batadv_frag_search_packet(&orig_node->
frag_list,
208 if (!tmp_frag_entry) {
209 batadv_frag_create_entry(&orig_node->
frag_list, skb);
214 *new_skb = batadv_frag_merge_packet(&orig_node->
frag_list,
215 tmp_frag_entry, skb);
234 int uc_hdr_len =
sizeof(*unicast_packet);
235 int ucf_hdr_len =
sizeof(*frag1);
240 primary_if = batadv_primary_if_get_selected(bat_priv);
244 frag_skb = dev_alloc_skb(data_len - (data_len / 2) + ucf_hdr_len);
247 skb_reserve(frag_skb, ucf_hdr_len);
250 memcpy(&tmp_uc, unicast_packet, uc_hdr_len);
251 skb_split(skb, frag_skb, data_len / 2 + uc_hdr_len);
260 memcpy(frag1, &tmp_uc,
sizeof(tmp_uc));
267 memcpy(frag2, frag1,
sizeof(*frag2));
273 frag2->
flags = large_tail;
290 batadv_hardif_free_ref(primary_if);
302 unsigned int dev_mtu;
305 if (is_multicast_ether_addr(ethhdr->
h_dest)) {
348 unicast_packet->
ttvn = unicast_packet->
ttvn - 1;
350 dev_mtu = neigh_node->if_incoming->net_dev->mtu;
352 data_len +
sizeof(*unicast_packet) > dev_mtu) {
354 unicast_packet->
header.ttl++;
356 neigh_node->if_incoming,