Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197349
b: refs/heads/master
c: f347b87
h: refs/heads/master
i:
  197347: 318b092
v: v3
  • Loading branch information
Sven Eckelmann authored and Greg Kroah-Hartman committed May 11, 2010
1 parent fbaab51 commit fb77c51
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: adaaa0c6ab89e82684389b80002bce893179cf2c
refs/heads/master: f347b8736f176681fbfc666bf00165125a3274a5
16 changes: 12 additions & 4 deletions trunk/drivers/staging/batman-adv/routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ int recv_bat_packet(struct sk_buff *skb,
{
struct ethhdr *ethhdr;
unsigned long flags;
struct sk_buff *skb_old;

/* drop packet if it has not necessary minimum size */
if (skb_headlen(skb) < sizeof(struct batman_packet))
Expand All @@ -564,12 +565,19 @@ int recv_bat_packet(struct sk_buff *skb,
if (is_bcast(ethhdr->h_source))
return NET_RX_DROP;

spin_lock_irqsave(&orig_hash_lock, flags);
/* TODO: we use headlen instead of "length", because
* only this data is paged in. */
/* TODO: is another skb_copy needed here? there will be
* written on the data, but nobody (?) should further use
* this data */

/* create a copy of the skb, if needed, to modify it. */
if (!skb_clone_writable(skb, skb_headlen(skb))) {
skb_old = skb;
skb = skb_copy(skb, GFP_ATOMIC);
if (!skb)
return NET_RX_DROP;
kfree_skb(skb_old);
}

spin_lock_irqsave(&orig_hash_lock, flags);
receive_aggr_bat_packet(ethhdr,
skb->data,
skb_headlen(skb),
Expand Down

0 comments on commit fb77c51

Please sign in to comment.