Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340536
b: refs/heads/master
c: b8fcfa4
h: refs/heads/master
v: v3
  • Loading branch information
Antonio Quartulli committed Oct 29, 2012
1 parent 8aedd61 commit e93660d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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: 60c39c7584e1bb69cdce4e0a9ee1e78ba09c82b9
refs/heads/master: b8fcfa42e4ec5d55d4cccd5c728415e8bca0539d
8 changes: 6 additions & 2 deletions trunk/net/batman-adv/routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,12 @@ static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv,
bool tt_poss_change;
int is_old_ttvn;

/* I could need to modify it */
if (skb_cow(skb, sizeof(struct batadv_unicast_packet)) < 0)
/* check if there is enough data before accessing it */
if (pskb_may_pull(skb, sizeof(*unicast_packet) + ETH_HLEN) < 0)
return 0;

/* create a copy of the skb (in case of for re-routing) to modify it. */
if (skb_cow(skb, sizeof(*unicast_packet)) < 0)
return 0;

unicast_packet = (struct batadv_unicast_packet *)skb->data;
Expand Down

0 comments on commit e93660d

Please sign in to comment.