aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-12-22 12:52:42 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:57 -0500
commita3edb08311fc559652ffc959e93eb5be9294443f (patch)
tree5e3795acaf64e34703c006a548f013ff0401e97a
parent7eefb04eb0761ce220890975fe33b7c262612c0d (diff)
annotate tun
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/tun.c2
-rw-r--r--include/linux/if_tun.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 5db4df460049..46339f6bcd00 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -506,7 +506,7 @@ static int tun_set_iff(struct file *file, struct ifreq *ifr)
506 /* Be promiscuous by default to maintain previous behaviour. */ 506 /* Be promiscuous by default to maintain previous behaviour. */
507 tun->if_flags = IFF_PROMISC; 507 tun->if_flags = IFF_PROMISC;
508 /* Generate random Ethernet address. */ 508 /* Generate random Ethernet address. */
509 *(u16 *)tun->dev_addr = htons(0x00FF); 509 *(__be16 *)tun->dev_addr = htons(0x00FF);
510 get_random_bytes(tun->dev_addr + sizeof(u16), 4); 510 get_random_bytes(tun->dev_addr + sizeof(u16), 4);
511 memset(tun->chr_filter, 0, sizeof tun->chr_filter); 511 memset(tun->chr_filter, 0, sizeof tun->chr_filter);
512 512
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 33e489d5bb33..72f1c5f47be3 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -21,6 +21,8 @@
21/* Uncomment to enable debugging */ 21/* Uncomment to enable debugging */
22/* #define TUN_DEBUG 1 */ 22/* #define TUN_DEBUG 1 */
23 23
24#include <linux/types.h>
25
24#ifdef __KERNEL__ 26#ifdef __KERNEL__
25 27
26#ifdef TUN_DEBUG 28#ifdef TUN_DEBUG
@@ -88,7 +90,7 @@ struct tun_struct {
88 90
89struct tun_pi { 91struct tun_pi {
90 unsigned short flags; 92 unsigned short flags;
91 unsigned short proto; 93 __be16 proto;
92}; 94};
93#define TUN_PKT_STRIP 0x0001 95#define TUN_PKT_STRIP 0x0001
94 96