[SK_BUFF]: Introduce skb_reset_mac_header(skb)
[deliverable/linux.git] / drivers / net / tun.c
index 151a2e10e4f3dc980720dcbd277dd240ea84174a..288d8559f8c5c48238a231331156454b0a735288 100644 (file)
@@ -254,11 +254,11 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
                return -EFAULT;
        }
 
-       skb->dev = tun->dev;
        switch (tun->flags & TUN_TYPE_MASK) {
        case TUN_TUN_DEV:
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
                skb->protocol = pi.proto;
+               skb->dev = tun->dev;
                break;
        case TUN_TAP_DEV:
                skb->protocol = eth_type_trans(skb, tun->dev);
@@ -744,7 +744,7 @@ static int tun_chr_close(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations tun_fops = {
+static const struct file_operations tun_fops = {
        .owner  = THIS_MODULE,
        .llseek = no_llseek,
        .read  = do_sync_read,
This page took 0.026667 seconds and 5 git commands to generate.