tun.c (2fc2991175bf77395e6b15fe6b2304d3bf72da40) | tun.c (8f22757ee84da64d4f662f1dd03dae95358a1efe) |
---|---|
1/* 2 * TUN - Universal TUN/TAP device driver. 3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 235 unchanged lines hidden (view full) --- 244 245 if (!(skb = alloc_skb(len + align, GFP_KERNEL))) { 246 tun->stats.rx_dropped++; 247 return -ENOMEM; 248 } 249 250 if (align) 251 skb_reserve(skb, align); | 1/* 2 * TUN - Universal TUN/TAP device driver. 3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 235 unchanged lines hidden (view full) --- 244 245 if (!(skb = alloc_skb(len + align, GFP_KERNEL))) { 246 tun->stats.rx_dropped++; 247 return -ENOMEM; 248 } 249 250 if (align) 251 skb_reserve(skb, align); |
252 if (memcpy_fromiovec(skb_put(skb, len), iv, len)) | 252 if (memcpy_fromiovec(skb_put(skb, len), iv, len)) { 253 tun->stats.rx_dropped++; 254 kfree_skb(skb); |
253 return -EFAULT; | 255 return -EFAULT; |
256 } |
|
254 255 skb->dev = tun->dev; 256 switch (tun->flags & TUN_TYPE_MASK) { 257 case TUN_TUN_DEV: 258 skb->mac.raw = skb->data; 259 skb->protocol = pi.proto; 260 break; 261 case TUN_TAP_DEV: --- 637 unchanged lines hidden --- | 257 258 skb->dev = tun->dev; 259 switch (tun->flags & TUN_TYPE_MASK) { 260 case TUN_TUN_DEV: 261 skb->mac.raw = skb->data; 262 skb->protocol = pi.proto; 263 break; 264 case TUN_TAP_DEV: --- 637 unchanged lines hidden --- |