mpls: Return error for RTA_GATEWAY attribute [Linux 5.0]

mpls: Return error for RTA_GATEWAY attribute [Linux 5.0]

This Linux kernel change "mpls: Return error for RTA_GATEWAY attribute" is included in the Linux 5.0 release. This change is authored by David Ahern <dsahern [at] gmail.com> on Tue Feb 26 09:00:04 2019 -0800. The commit for this change in Linux stable tree is be48220 (patch).

mpls: Return error for RTA_GATEWAY attribute

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.

Fixes: 03c0566542f4c ("mpls: Netlink commands to add, remove, and dump routes")
Signed-off-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

There are 3 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 net/mpls/af_mpls.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index 7d55d4c..fa763e2 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -1838,6 +1838,9 @@ static int rtm_to_route_config(struct sk_buff *skb,
                goto errout;
            break;
        }
+       case RTA_GATEWAY:
+           NL_SET_ERR_MSG(extack, "MPLS does not support RTA_GATEWAY attribute");
+           goto errout;
        case RTA_VIA:
        {
            if (nla_get_via(nla, &cfg->rc_via_alen,

Leave a Reply

Your email address will not be published. Required fields are marked *