Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

annotate tun

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by

Al Viro and committed by
David S. Miller
a3edb083 7eefb04e

+4 -2
+1 -1
drivers/net/tun.c
··· 506 506 /* Be promiscuous by default to maintain previous behaviour. */ 507 507 tun->if_flags = IFF_PROMISC; 508 508 /* Generate random Ethernet address. */ 509 - *(u16 *)tun->dev_addr = htons(0x00FF); 509 + *(__be16 *)tun->dev_addr = htons(0x00FF); 510 510 get_random_bytes(tun->dev_addr + sizeof(u16), 4); 511 511 memset(tun->chr_filter, 0, sizeof tun->chr_filter); 512 512
+3 -1
include/linux/if_tun.h
··· 21 21 /* Uncomment to enable debugging */ 22 22 /* #define TUN_DEBUG 1 */ 23 23 24 + #include <linux/types.h> 25 + 24 26 #ifdef __KERNEL__ 25 27 26 28 #ifdef TUN_DEBUG ··· 90 88 91 89 struct tun_pi { 92 90 unsigned short flags; 93 - unsigned short proto; 91 + __be16 proto; 94 92 }; 95 93 #define TUN_PKT_STRIP 0x0001 96 94