annotate tun
authorAl Viro <viro@ftp.linux.org.uk>
Sat, 22 Dec 2007 17:52:42 +0000 (17:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:07:57 +0000 (15:07 -0800)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/tun.c
include/linux/if_tun.h

index 5db4df4600492d4fb1c7a3c7e5e85f7fef6e2c55..46339f6bcd004b9ca6b443cad05df2c82742cf32 100644 (file)
@@ -506,7 +506,7 @@ static int tun_set_iff(struct file *file, struct ifreq *ifr)
                /* Be promiscuous by default to maintain previous behaviour. */
                tun->if_flags = IFF_PROMISC;
                /* Generate random Ethernet address. */
-               *(u16 *)tun->dev_addr = htons(0x00FF);
+               *(__be16 *)tun->dev_addr = htons(0x00FF);
                get_random_bytes(tun->dev_addr + sizeof(u16), 4);
                memset(tun->chr_filter, 0, sizeof tun->chr_filter);
 
index 33e489d5bb33ed4e476360577474a90f580e2b2c..72f1c5f47be325444270ec2ccd81fbfea927914b 100644 (file)
@@ -21,6 +21,8 @@
 /* Uncomment to enable debugging */
 /* #define TUN_DEBUG 1 */
 
+#include <linux/types.h>
+
 #ifdef __KERNEL__
 
 #ifdef TUN_DEBUG
@@ -88,7 +90,7 @@ struct tun_struct {
 
 struct tun_pi {
        unsigned short flags;
-       unsigned short proto;
+       __be16 proto;
 };
 #define TUN_PKT_STRIP  0x0001