• Al Viro's avatar
    ip6_tunnel - endianness annotations · 704eae1f
    Al Viro authored
    Convert rel_info to host-endian before calling ip6_tnl_err().
    The things become much more straightforward that way.
    The key observation (and the reason why that code actually
    worked) is that after ip6_tnl_err() we either immediately
    bailed out or had rel_info set to 0 or had it set to host-endian
    and guaranteed to hit
    (rel_type == ICMP_DEST_UNREACH && rel_code == ICMP_FRAG_NEEDED)
    case.  So inconsistent endianness didn't really lead to bugs,
    but it had been subtle and prone to breakage.  New variant is
    saner and obviously safe.
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    704eae1f
ip6_tunnel.c 33.4 KB