On Sun, Oct 30, 2011 at 09:55:57AM +0100, Antonio Quartulli wrote:
@@ -304,33 +331,22 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv) orig_node = transtable_search(bat_priv, ethhdr->h_source, ethhdr->h_dest);
-find_router: +prepare_packet: /** * find_router():
I guess the comment should be changed as well when the label is renamed.
* - if orig_node is NULL it returns NULL * - increases neigh_nodes refcount if found. */
neigh_node = find_router(bat_priv, orig_node, NULL);
Do we really need to remove this newline?
if (!neigh_node) goto out;
- if (my_skb_head_push(skb, sizeof(*unicast_packet)) < 0)
skb = prepare_unicast_packet(skb, orig_node);
if (!skb) goto out;
unicast_packet = (struct unicast_packet *)skb->data;
- unicast_packet->version = COMPAT_VERSION;
- /* batman packet type: unicast */
- unicast_packet->packet_type = BAT_UNICAST;
- /* set unicast ttl */
- unicast_packet->ttl = TTL;
- /* copy the destination for faster routing */
- memcpy(unicast_packet->dest, orig_node->orig, ETH_ALEN);
- /* set the destination tt version number */
- unicast_packet->ttvn =
(uint8_t)atomic_read(&orig_node->last_ttvn);
- if (atomic_read(&bat_priv->fragmentation) && data_len + sizeof(*unicast_packet) > neigh_node->if_incoming->net_dev->mtu) {
@@ -350,7 +366,7 @@ out: neigh_node_free_ref(neigh_node); if (orig_node) orig_node_free_ref(orig_node);
- if (ret == 1)
- if (ret == 1 && skb) kfree_skb(skb); return ret;
}