The following commit has been merged in the master branch: commit ab889e6607f6e3d52a76c5a43c8c4ad1d354da36 Merge: dcf96f1ff66f328fecf1e14437ac73db71b08c03 3878f1f075470990d9c2418b53f31694e774f743 Author: David S. Miller davem@davemloft.net Date: Fri Feb 11 21:20:27 2011 -0800
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
diff --combined net/batman-adv/unicast.c index bedf294,1b5e761..121b11d --- a/net/batman-adv/unicast.c +++ b/net/batman-adv/unicast.c @@@ -39,8 -39,8 +39,8 @@@ static struct sk_buff *frag_merge_packe (struct unicast_frag_packet *)skb->data; struct sk_buff *tmp_skb; struct unicast_packet *unicast_packet; - int hdr_len = sizeof(struct unicast_packet), - uni_diff = sizeof(struct unicast_frag_packet) - hdr_len; + int hdr_len = sizeof(struct unicast_packet); + int uni_diff = sizeof(struct unicast_frag_packet) - hdr_len;
/* set skb to the first part and tmp_skb to the second part */ if (up->flags & UNI_FRAG_HEAD) { @@@ -50,12 -50,12 +50,12 @@@ skb = tfp->skb; }
+ if (skb_linearize(skb) < 0 || skb_linearize(tmp_skb) < 0) + goto err; + skb_pull(tmp_skb, sizeof(struct unicast_frag_packet)); - if (pskb_expand_head(skb, 0, tmp_skb->len, GFP_ATOMIC) < 0) { - /* free buffered skb, skb will be freed later */ - kfree_skb(tfp->skb); - return NULL; - } + if (pskb_expand_head(skb, 0, tmp_skb->len, GFP_ATOMIC) < 0) + goto err;
/* move free entry to end */ tfp->skb = NULL; @@@ -70,11 -70,6 +70,11 @@@ unicast_packet->packet_type = BAT_UNICAST;
return skb; + +err: + /* free buffered skb, skb will be freed later */ + kfree_skb(tfp->skb); + return NULL; }
static void frag_create_entry(struct list_head *head, struct sk_buff *skb) @@@ -231,6 -226,7 +231,7 @@@ int frag_send_skb(struct sk_buff *skb, int ucf_hdr_len = sizeof(struct unicast_frag_packet); int data_len = skb->len - uc_hdr_len; int large_tail = 0; + uint16_t seqno;
if (!bat_priv->primary_if) goto dropped; @@@ -266,10 -262,9 +267,9 @@@ frag1->flags = UNI_FRAG_HEAD | large_tail; frag2->flags = large_tail;
- frag1->seqno = htons((uint16_t)atomic_inc_return( - &batman_if->frag_seqno)); - frag2->seqno = htons((uint16_t)atomic_inc_return( - &batman_if->frag_seqno)); + seqno = atomic_add_return(2, &batman_if->frag_seqno); + frag1->seqno = htons(seqno - 1); + frag2->seqno = htons(seqno);
send_skb_packet(skb, batman_if, dstaddr); send_skb_packet(frag_skb, batman_if, dstaddr); @@@ -286,7 -281,7 +286,7 @@@ int unicast_send_skb(struct sk_buff *sk { struct ethhdr *ethhdr = (struct ethhdr *)skb->data; struct unicast_packet *unicast_packet; - struct orig_node *orig_node; + struct orig_node *orig_node = NULL; struct batman_if *batman_if; struct neigh_node *router; int data_len = skb->len; @@@ -297,11 -292,6 +297,6 @@@ /* get routing information */ if (is_multicast_ether_addr(ethhdr->h_dest)) orig_node = (struct orig_node *)gw_get_selected(bat_priv); - else - orig_node = ((struct orig_node *)hash_find(bat_priv->orig_hash, - compare_orig, - choose_orig, - ethhdr->h_dest));
/* check for hna host */ if (!orig_node)