]> git.proxmox.com Git - mirror_iproute2.git/commit
mpls: always set type RTN_UNICAST and scope RT_SCOPE_UNIVERSE for
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Fri, 26 Jun 2015 03:54:27 +0000 (23:54 -0400)
committerStephen Hemminger <shemming@brocade.com>
Fri, 26 Jun 2015 03:54:27 +0000 (23:54 -0400)
commitf638e9f7c8718cd5f94bd1f6041319e7d65a91cd
tree17b27d4db2f9c3503633ce5ea57db8d658e419d0
parentecb435eacd50161d2a7cce5731a269ef916c0dd4
mpls: always set type RTN_UNICAST and scope RT_SCOPE_UNIVERSE for

This patch fixes incorrect -EINVAL errors due to invalid
scope and type during mpls route deletes.

$ip -f mpls route add 100 as 200 via inet 10.1.1.2 dev swp1

$ip -f mpls route show
100 as to 200 via inet 10.1.1.2 dev swp1

$ip -f mpls route del 100 as 200 via inet 10.1.1.2 dev swp1
RTNETLINK answers: Invalid argument

$ip -f mpls route del 100
RTNETLINK answers: Invalid argument

After patch:

$ip -f mpls route show
100 as to 200 via inet 10.1.1.2 dev swp1

$ip -f mpls route del 100 as 200 via inet 10.1.1.2 dev swp1

$ip -f mpls route show

Always set type to RTN_UNICAST for mpls route add/deletes.
Also to keep things consistent with kernel set scope to
RT_SCOPE_UNIVERSE for both mpls and ipv6 routes. Both mpls and ipv6 route
deletes ignore scope.

Suggested-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
ip/iproute.c