• Eric W. Biederman's avatar
    tun: Introduce tun_file · 631ab46b
    Eric W. Biederman authored
    Currently the tun code suffers from only having a single word of
    data that exists for the entire life of the tun file descriptor.
    
    This results in peculiar holding of references to the network namespace
    as well as races between free_netdevice and tun_chr_close.
    
    Fix this by introducing tun_file which will hold the per file state.
    For the moment it still holds just a single word so the differences
    are all logic changes with no changes in semantics.
    Signed-off-by: default avatarEric W. Biederman <ebiederm@aristanetworks.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    631ab46b
tun.c 28.6 KB