1
0
Fork 0
alistair23-linux/net/mpls
Roopa Prabhu 397fc9e5ce mpls: route get support
This patch adds RTM_GETROUTE doit handler for mpls routes.

Input:
RTA_DST - input label
RTA_NEWDST - labels in packet for multipath selection

By default the getroute handler returns matched
nexthop label, via and oif

With RTM_F_FIB_MATCH flag, full matched route is
returned.

example (with patched iproute2):
$ip -f mpls route show
101
        nexthop as to 102/103 via inet 172.16.2.2 dev virt1-2
        nexthop as to 302/303 via inet 172.16.12.2 dev virt1-12
201
        nexthop as to 202/203 via inet6 2001:db8:2::2 dev virt1-2
        nexthop as to 402/403 via inet6 2001:db8:12::2 dev virt1-12

$ip -f mpls route get 103
RTNETLINK answers: Network is unreachable

$ip -f mpls route get 101
101 as to 102/103 via inet 172.16.2.2 dev virt1-2

$ip -f mpls route get as to 302/303 101
101 as to 302/303 via inet 172.16.12.2 dev virt1-12

$ip -f mpls route get fibmatch 103
RTNETLINK answers: Network is unreachable

$ip -f mpls route get fibmatch 101
101
        nexthop as to 102/103 via inet 172.16.2.2 dev virt1-2
        nexthop as to 302/303 via inet 172.16.12.2 dev virt1-12

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-07-04 01:50:38 -07: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: route get support 2017-07-04 01:50:38 -07:00
internal.h net: mpls: Make nla_get_via in af_mpls.c 2017-05-30 11:55:33 -04:00
mpls_gso.c net: mpls: Fixups for GSO 2016-08-30 22:27:18 -07:00
mpls_iptunnel.c net: Fill in extack for mpls lwt encap 2017-05-30 11:55:32 -04:00