net: Set strict_start_type for routes and rules
New userspace on an older kernel can send unknown and unsupported attributes resulting in an incompelete config which is almost always wrong for routing (few exceptions are passthrough settings like the protocol that installed the route). Set strict_start_type in the policies for IPv4 and IPv6 routes and rules to detect new, unsupported attributes and fail the route add. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
e38f7cbd36
commit
75425657fe
@@ -4221,6 +4221,7 @@ void rt6_mtu_change(struct net_device *dev, unsigned int mtu)
|
||||
}
|
||||
|
||||
static const struct nla_policy rtm_ipv6_policy[RTA_MAX+1] = {
|
||||
[RTA_UNSPEC] = { .strict_start_type = RTA_DPORT + 1 },
|
||||
[RTA_GATEWAY] = { .len = sizeof(struct in6_addr) },
|
||||
[RTA_PREFSRC] = { .len = sizeof(struct in6_addr) },
|
||||
[RTA_OIF] = { .type = NLA_U32 },
|
||||
|
Reference in New Issue
Block a user