From: David Ahern <dsahern@gmail.com>
Date: Tue, 26 Feb 2019 09:00:04 -0800
Subject: mpls: Return error for RTA_GATEWAY attribute
Git-commit: be48220edd48ca0d569782992840488a52373a24
Patch-mainline: v5.0
References: networking-stable-19_03_07
MPLS does not support nexthops with an MPLS address family.
Specifically, it does not handle RTA_GATEWAY attribute. Make it
clear by returning an error.
[js] no extack in 4.12 here yet.
Fixes: 03c0566542f4c ("mpls: Netlink commands to add, remove, and dump routes")
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
net/mpls/af_mpls.c | 3 +++
1 file changed, 3 insertions(+)
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -1712,6 +1712,8 @@ static int rtm_to_route_config(struct sk
break;
}
+ case RTA_GATEWAY:
+ goto errout;
case RTA_VIA:
{
if (nla_get_via(nla, &cfg->rc_via_alen,