Skip to content

Commit

Permalink
mpls: Return error for RTA_GATEWAY attribute
Browse files Browse the repository at this point in the history
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: 03c0566 ("mpls: Netlink commands to add, remove, and dump routes")
Signed-off-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
dsahern authored and davem330 committed Feb 26, 2019
1 parent e381854 commit be48220
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/mpls/af_mpls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit be48220

Please sign in to comment.