• Paolo Abeni's avatar
    net/route: enforce hoplimit max value · 3522956c
    Paolo Abeni authored
    [ Upstream commit 626abd59 ]
    
    Currently, when creating or updating a route, no check is performed
    in both ipv4 and ipv6 code to the hoplimit value.
    
    The caller can i.e. set hoplimit to 256, and when such route will
     be used, packets will be sent with hoplimit/ttl equal to 0.
    
    This commit adds checks for the RTAX_HOPLIMIT value, in both ipv4
    ipv6 route code, substituting any value greater than 255 with 255.
    
    This is consistent with what is currently done for ADVMSS and MTU
    in the ipv4 code.
    
    [js] backport to 3.12: no ip6_convert_metrics yet, fix applied to
         ip6_route_add directly.
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
    3522956c
fib_semantics.c 31 KB