]> git.baikalelectronics.ru Git - kernel.git/commit
net/route: enforce hoplimit max value
authorPaolo Abeni <pabeni@redhat.com>
Fri, 13 May 2016 16:33:41 +0000 (18:33 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 May 2016 19:33:32 +0000 (15:33 -0400)
commit0f42a89d87b9b73b04b217e09a1c6624470c6a0f
tree82140aaabeabc172e13cf5fc78d564a93acd5a0d
parentc74e96d929df2e35f7f388a6d5b6d3510ab9b5c3
net/route: enforce hoplimit max value

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.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_semantics.c
net/ipv6/route.c