linux-brain/net/mpls
George Wilkie 21b0815f71 mpls: fix warning with multi-label encap
[ Upstream commit 2f3f7d1fa0 ]

If you configure a route with multiple labels, e.g.
  ip route add 10.10.3.0/24 encap mpls 16/100 via 10.10.2.2 dev ens4
A warning is logged:
  kernel: [  130.561819] netlink: 'ip': attribute type 1 has an invalid
  length.

This happens because mpls_iptunnel_policy has set the type of
MPLS_IPTUNNEL_DST to fixed size NLA_U32.
Change it to a minimum size.
nla_get_labels() does the remaining validation.

Fixes: e3e4712ec0 ("mpls: ip tunnel support")
Signed-off-by: George Wilkie <gwilkie@vyatta.att-mail.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:46:37 +01:00
..
Kconfig mpls: ip tunnel support 2015-07-21 10:39:05 -07:00
Makefile mpls: ip tunnel support 2015-07-21 10:39:05 -07:00
af_mpls.c mpls: Return error for RTA_GATEWAY attribute 2019-03-13 14:03:09 -07:00
internal.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mpls_gso.c net: mpls: Fixups for GSO 2016-08-30 22:27:18 -07:00
mpls_iptunnel.c mpls: fix warning with multi-label encap 2020-01-27 14:46:37 +01:00