summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-01-19 16:27:01 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2017-03-07 16:20:29 +0100
commit2fb975da777d27077b3580cb18390b5015b50fb8 (patch)
treea0877c908b64c4dc1cfb6101e61420007038aeca /zebra
parentMerge branch 'frr/pull/255' ("vtysh: Fix cli help string to have only 1 menti... (diff)
downloadfrr-2fb975da777d27077b3580cb18390b5015b50fb8.tar.xz
frr-2fb975da777d27077b3580cb18390b5015b50fb8.zip
nhrpd: implement next hop resolution protocol
This provides DMVPN support and integrates to strongSwan. Please read README.nhrpd and README.kernel for more details. [DL: cherry-picked from dafa05e65fe4b3b3ed5525443f554215ba14f42c] [DL: merge partially resolved, this commit will not build.] Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/client_main.c1
-rw-r--r--zebra/zebra_rib.c2
-rw-r--r--zebra/zebra_rnh.c25
-rw-r--r--zebra/zebra_vty.c3
4 files changed, 23 insertions, 8 deletions
diff --git a/zebra/client_main.c b/zebra/client_main.c
index f40d99546..178184d46 100644
--- a/zebra/client_main.c
+++ b/zebra/client_main.c
@@ -115,6 +115,7 @@ struct zebra_info
{ "ospf", ZEBRA_ROUTE_OSPF },
{ "ospf6", ZEBRA_ROUTE_OSPF6 },
{ "bgp", ZEBRA_ROUTE_BGP },
+ { "nhrp", ZEBRA_ROUTE_NHRP },
{ NULL, 0 }
};
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 08874f22f..56a5f8e58 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -78,6 +78,7 @@ static const struct
[ZEBRA_ROUTE_OSPF6] = {ZEBRA_ROUTE_OSPF6, 110},
[ZEBRA_ROUTE_ISIS] = {ZEBRA_ROUTE_ISIS, 115},
[ZEBRA_ROUTE_BGP] = {ZEBRA_ROUTE_BGP, 20 /* IBGP is 200. */},
+ [ZEBRA_ROUTE_NHRP] = {ZEBRA_ROUTE_NHRP, 10},
/* no entry/default: 150 */
};
@@ -1822,6 +1823,7 @@ static const u_char meta_queue_map[ZEBRA_ROUTE_MAX] = {
[ZEBRA_ROUTE_OSPF] = 2,
[ZEBRA_ROUTE_OSPF6] = 2,
[ZEBRA_ROUTE_ISIS] = 2,
+ [ZEBRA_ROUTE_NHRP] = 2,
[ZEBRA_ROUTE_BGP] = 3,
[ZEBRA_ROUTE_HSLS] = 4,
[ZEBRA_ROUTE_TABLE] = 1,
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index b180930a0..723a3ec30 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -376,19 +376,28 @@ zebra_rnh_resolve_entry (vrf_id_t vrfid, int family, rnh_type_t type,
{
if (CHECK_FLAG (rib->status, RIB_ENTRY_REMOVED))
continue;
- if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
+ if (! CHECK_FLAG (rib->status, RIB_ENTRY_SELECTED_FIB))
+ continue;
+
+ if (CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED))
{
- if (CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED))
+ if (rib->type == ZEBRA_ROUTE_CONNECT)
+ break;
+ if (rib->type == ZEBRA_ROUTE_NHRP)
{
- if (rib->type == ZEBRA_ROUTE_CONNECT)
+ struct nexthop *nexthop;
+ for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
+ if (nexthop->type == NEXTHOP_TYPE_IFINDEX)
+ break;
+ if (nexthop)
break;
}
- else if ((type == RNH_IMPORT_CHECK_TYPE) &&
- (rib->type == ZEBRA_ROUTE_BGP))
- continue;
- else
- break;
}
+ else if ((type == RNH_IMPORT_CHECK_TYPE) &&
+ (rib->type == ZEBRA_ROUTE_BGP))
+ continue;
+ else
+ break;
}
}
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 17d824990..ddb037335 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -684,6 +684,7 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
if (rib->type == ZEBRA_ROUTE_RIP
|| rib->type == ZEBRA_ROUTE_OSPF
|| rib->type == ZEBRA_ROUTE_ISIS
+ || rib->type == ZEBRA_ROUTE_NHRP
|| rib->type == ZEBRA_ROUTE_TABLE
|| rib->type == ZEBRA_ROUTE_BGP)
{
@@ -835,6 +836,7 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib,
if (rib->type == ZEBRA_ROUTE_RIP
|| rib->type == ZEBRA_ROUTE_OSPF
|| rib->type == ZEBRA_ROUTE_ISIS
+ || rib->type == ZEBRA_ROUTE_NHRP
|| rib->type == ZEBRA_ROUTE_TABLE
|| rib->type == ZEBRA_ROUTE_BGP)
{
@@ -1041,6 +1043,7 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib,
if (rib->type == ZEBRA_ROUTE_RIP
|| rib->type == ZEBRA_ROUTE_OSPF
|| rib->type == ZEBRA_ROUTE_ISIS
+ || rib->type == ZEBRA_ROUTE_NHRP
|| rib->type == ZEBRA_ROUTE_TABLE
|| rib->type == ZEBRA_ROUTE_BGP)
{