diff options
author | David S. Miller <davem@davemloft.net> | 2011-02-12 00:20:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-12 00:20:27 -0500 |
commit | ab889e6607f6e3d52a76c5a43c8c4ad1d354da36 (patch) | |
tree | bb98f2977e03bd2d4812ec5442e6cfb0e7678721 /net/batman-adv/unicast.c | |
parent | dcf96f1ff66f328fecf1e14437ac73db71b08c03 (diff) | |
parent | 3878f1f075470990d9c2418b53f31694e774f743 (diff) |
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
Diffstat (limited to 'net/batman-adv/unicast.c')
-rw-r--r-- | net/batman-adv/unicast.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c index bedf29425775..121b11d2a23d 100644 --- a/net/batman-adv/unicast.c +++ b/net/batman-adv/unicast.c | |||
@@ -39,8 +39,8 @@ static struct sk_buff *frag_merge_packet(struct list_head *head, | |||
39 | (struct unicast_frag_packet *)skb->data; | 39 | (struct unicast_frag_packet *)skb->data; |
40 | struct sk_buff *tmp_skb; | 40 | struct sk_buff *tmp_skb; |
41 | struct unicast_packet *unicast_packet; | 41 | struct unicast_packet *unicast_packet; |
42 | int hdr_len = sizeof(struct unicast_packet), | 42 | int hdr_len = sizeof(struct unicast_packet); |
43 | uni_diff = sizeof(struct unicast_frag_packet) - hdr_len; | 43 | int uni_diff = sizeof(struct unicast_frag_packet) - hdr_len; |
44 | 44 | ||
45 | /* set skb to the first part and tmp_skb to the second part */ | 45 | /* set skb to the first part and tmp_skb to the second part */ |
46 | if (up->flags & UNI_FRAG_HEAD) { | 46 | if (up->flags & UNI_FRAG_HEAD) { |
@@ -231,6 +231,7 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, | |||
231 | int ucf_hdr_len = sizeof(struct unicast_frag_packet); | 231 | int ucf_hdr_len = sizeof(struct unicast_frag_packet); |
232 | int data_len = skb->len - uc_hdr_len; | 232 | int data_len = skb->len - uc_hdr_len; |
233 | int large_tail = 0; | 233 | int large_tail = 0; |
234 | uint16_t seqno; | ||
234 | 235 | ||
235 | if (!bat_priv->primary_if) | 236 | if (!bat_priv->primary_if) |
236 | goto dropped; | 237 | goto dropped; |
@@ -266,10 +267,9 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, | |||
266 | frag1->flags = UNI_FRAG_HEAD | large_tail; | 267 | frag1->flags = UNI_FRAG_HEAD | large_tail; |
267 | frag2->flags = large_tail; | 268 | frag2->flags = large_tail; |
268 | 269 | ||
269 | frag1->seqno = htons((uint16_t)atomic_inc_return( | 270 | seqno = atomic_add_return(2, &batman_if->frag_seqno); |
270 | &batman_if->frag_seqno)); | 271 | frag1->seqno = htons(seqno - 1); |
271 | frag2->seqno = htons((uint16_t)atomic_inc_return( | 272 | frag2->seqno = htons(seqno); |
272 | &batman_if->frag_seqno)); | ||
273 | 273 | ||
274 | send_skb_packet(skb, batman_if, dstaddr); | 274 | send_skb_packet(skb, batman_if, dstaddr); |
275 | send_skb_packet(frag_skb, batman_if, dstaddr); | 275 | send_skb_packet(frag_skb, batman_if, dstaddr); |
@@ -286,7 +286,7 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv) | |||
286 | { | 286 | { |
287 | struct ethhdr *ethhdr = (struct ethhdr *)skb->data; | 287 | struct ethhdr *ethhdr = (struct ethhdr *)skb->data; |
288 | struct unicast_packet *unicast_packet; | 288 | struct unicast_packet *unicast_packet; |
289 | struct orig_node *orig_node; | 289 | struct orig_node *orig_node = NULL; |
290 | struct batman_if *batman_if; | 290 | struct batman_if *batman_if; |
291 | struct neigh_node *router; | 291 | struct neigh_node *router; |
292 | int data_len = skb->len; | 292 | int data_len = skb->len; |
@@ -297,11 +297,6 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv) | |||
297 | /* get routing information */ | 297 | /* get routing information */ |
298 | if (is_multicast_ether_addr(ethhdr->h_dest)) | 298 | if (is_multicast_ether_addr(ethhdr->h_dest)) |
299 | orig_node = (struct orig_node *)gw_get_selected(bat_priv); | 299 | orig_node = (struct orig_node *)gw_get_selected(bat_priv); |
300 | else | ||
301 | orig_node = ((struct orig_node *)hash_find(bat_priv->orig_hash, | ||
302 | compare_orig, | ||
303 | choose_orig, | ||
304 | ethhdr->h_dest)); | ||
305 | 300 | ||
306 | /* check for hna host */ | 301 | /* check for hna host */ |
307 | if (!orig_node) | 302 | if (!orig_node) |