Skip to content
Snippets Groups Projects
  • David S. Miller's avatar
    f23d60de
    ipv6: Fix duplicate initialization of rawv6_prot.destroy · f23d60de
    David S. Miller authored
    
    In changeset 22dd4850
    ("raw: Raw socket leak.") code was added so that we
    flush pending frames on raw sockets to avoid leaks.
    
    The ipv4 part was fine, but the ipv6 part was not
    done correctly.  Unlike the ipv4 side, the ipv6 code
    already has a .destroy method for rawv6_prot.
    
    So now there were two assignments to this member, and
    what the compiler does is use the last one, effectively
    making the ipv6 parts of that changeset a NOP.
    
    Fix this by removing the:
    
    	.destroy	   = inet6_destroy_sock,
    
    line, and adding an inet6_destroy_sock() call to the
    end of raw6_destroy().
    
    Noticed by Al Viro.
    
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Acked-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
    f23d60de
    History
    ipv6: Fix duplicate initialization of rawv6_prot.destroy
    David S. Miller authored
    
    In changeset 22dd4850
    ("raw: Raw socket leak.") code was added so that we
    flush pending frames on raw sockets to avoid leaks.
    
    The ipv4 part was fine, but the ipv6 part was not
    done correctly.  Unlike the ipv4 side, the ipv6 code
    already has a .destroy method for rawv6_prot.
    
    So now there were two assignments to this member, and
    what the compiler does is use the last one, effectively
    making the ipv6 parts of that changeset a NOP.
    
    Fix this by removing the:
    
    	.destroy	   = inet6_destroy_sock,
    
    line, and adding an inet6_destroy_sock() call to the
    end of raw6_destroy().
    
    Noticed by Al Viro.
    
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Acked-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>