diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/if_vlan.h | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index d36515dae62f..93f5d9b0e9f9 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -185,22 +185,10 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) | |||
185 | { | 185 | { |
186 | struct vlan_ethhdr *veth; | 186 | struct vlan_ethhdr *veth; |
187 | 187 | ||
188 | if (skb_headroom(skb) < VLAN_HLEN) { | 188 | if (skb_cow_head(skb, VLAN_HLEN) < 0) { |
189 | struct sk_buff *sk_tmp = skb; | 189 | kfree_skb(skb); |
190 | skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN); | 190 | return NULL; |
191 | kfree_skb(sk_tmp); | ||
192 | if (!skb) { | ||
193 | printk(KERN_ERR "vlan: failed to realloc headroom\n"); | ||
194 | return NULL; | ||
195 | } | ||
196 | } else { | ||
197 | skb = skb_unshare(skb, GFP_ATOMIC); | ||
198 | if (!skb) { | ||
199 | printk(KERN_ERR "vlan: failed to unshare skbuff\n"); | ||
200 | return NULL; | ||
201 | } | ||
202 | } | 191 | } |
203 | |||
204 | veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); | 192 | veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); |
205 | 193 | ||
206 | /* Move the mac addresses to the beginning of the new header. */ | 194 | /* Move the mac addresses to the beginning of the new header. */ |