Message ID | 1464112523-3701-35-git-send-email-kamal@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 71bad5c..fa767ed 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -858,6 +858,8 @@ struct fib_info *fib_create_info(struct fib_config *cfg) val = 65535 - 40; if (type == RTAX_MTU && val > 65535 - 15) val = 65535 - 15; + if (type == RTAX_HOPLIMIT && val > 255) + val = 255; fi->fib_metrics[type - 1] = val; } } diff --git a/net/ipv6/route.c b/net/ipv6/route.c index e36b7fe..e5ed7ed 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1728,6 +1728,8 @@ static int ip6_convert_metrics(struct mx6_config *mxc, } else { val = nla_get_u32(nla); } + if (type == RTAX_HOPLIMIT && val > 255) + val = 255; mp[type - 1] = val; __set_bit(type - 1, mxc->mx_valid);