summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-11-28 17:35:08 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2016-11-28 17:35:08 +0100
commitcdf76126497e0346e0cbb6fb27db2d24b3bc872e (patch)
tree43a505ff49a17f660e7f1a61fbb47ab1179d91ae /zebra
parent7fc0257282f6a719304018de7367ef9675cb63fb (diff)
parent18653436b7e7e5cb7a3ea8ba8a182598cbfbd247 (diff)
Merge remote-tracking branch 'cmaster-next' into cmaster-next-releng
Diffstat (limited to 'zebra')
-rw-r--r--zebra/interface.c19
-rw-r--r--zebra/zebra_rnh.c69
2 files changed, 53 insertions, 35 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 0f4d2ee9e4..b87f61f920 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1773,6 +1773,16 @@ DEFUN (link_params,
return CMD_SUCCESS;
}
+DEFUN (exit_link_params,
+ exit_link_params_cmd,
+ "exit-link-params",
+ "Exit from Link Params configuration mode\n")
+{
+ if (vty->node == LINK_PARAMS_NODE)
+ vty->node = INTERFACE_NODE;
+ return CMD_SUCCESS;
+}
+
/* Specific Traffic Engineering parameters commands */
DEFUN (link_params_enable,
link_params_enable_cmd,
@@ -2814,6 +2824,7 @@ link_params_config_write (struct vty *vty, struct interface *ifp)
if (IS_PARAM_SET(iflp, LP_RMT_AS))
vty_out(vty, " neighbor %s as %u%s", inet_ntoa(iflp->rmt_ip),
iflp->rmt_as, VTY_NEWLINE);
+ vty_out(vty, " exit-link-params%s", VTY_NEWLINE);
return 0;
}
@@ -2978,15 +2989,23 @@ zebra_if_init (void)
install_element(LINK_PARAMS_NODE, &link_params_max_rsv_bw_cmd);
install_element(LINK_PARAMS_NODE, &link_params_unrsv_bw_cmd);
install_element(LINK_PARAMS_NODE, &link_params_admin_grp_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_admin_grp_cmd);
install_element(LINK_PARAMS_NODE, &link_params_inter_as_cmd);
install_element(LINK_PARAMS_NODE, &no_link_params_inter_as_cmd);
install_element(LINK_PARAMS_NODE, &link_params_delay_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_delay_cmd);
install_element(LINK_PARAMS_NODE, &link_params_delay_mm_cmd);
install_element(LINK_PARAMS_NODE, &link_params_delay_var_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_delay_var_cmd);
install_element(LINK_PARAMS_NODE, &link_params_pkt_loss_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_pkt_loss_cmd);
install_element(LINK_PARAMS_NODE, &link_params_ava_bw_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_ava_bw_cmd);
install_element(LINK_PARAMS_NODE, &link_params_res_bw_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_res_bw_cmd);
install_element(LINK_PARAMS_NODE, &link_params_use_bw_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_use_bw_cmd);
+ install_element(LINK_PARAMS_NODE, &exit_link_params_cmd);
install_element (CONFIG_NODE, &zebra_vrf_cmd);
install_element (CONFIG_NODE, &no_vrf_cmd);
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index f88a6f0a98..062f9d3831 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -542,31 +542,28 @@ zebra_rnh_process_static_routes (vrf_id_t vrfid, int family,
RNODE_FOREACH_RIB(static_rn, srib)
{
if (srib->type == ZEBRA_ROUTE_STATIC)
- break; /* currently works for only 1 static route. */
- }
+ continue;
- if (!srib) // unexpected
- continue;
+ /* Set the filter flag for the correct nexthop - static route may
+ * be having multiple. We care here only about registered nexthops.
+ */
+ for (nexthop = srib->nexthop; nexthop; nexthop = nexthop->next)
+ {
+ switch (nexthop->type)
+ {
+ case NEXTHOP_TYPE_IPV4:
+ case NEXTHOP_TYPE_IPV4_IFINDEX:
+ if (nexthop->gate.ipv4.s_addr == nrn->p.u.prefix4.s_addr)
+ {
+ if (num_resolving_nh)
+ UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FILTERED);
+ else
+ SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FILTERED);
+ }
+ break;
+ case NEXTHOP_TYPE_IPV6:
+ case NEXTHOP_TYPE_IPV6_IFINDEX:
- /* Set the filter flag for the correct nexthop - static route may
- * be having multiple. We care here only about registered nexthops.
- */
- for (nexthop = srib->nexthop; nexthop; nexthop = nexthop->next)
- {
- switch (nexthop->type)
- {
- case NEXTHOP_TYPE_IPV4:
- case NEXTHOP_TYPE_IPV4_IFINDEX:
- if (nexthop->gate.ipv4.s_addr == nrn->p.u.prefix4.s_addr)
- {
- if (num_resolving_nh)
- UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FILTERED);
- else
- SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FILTERED);
- }
- break;
- case NEXTHOP_TYPE_IPV6:
- case NEXTHOP_TYPE_IPV6_IFINDEX:
if (memcmp(&nexthop->gate.ipv6,&nrn->p.u.prefix6, 16) == 0)
{
if (num_resolving_nh)
@@ -580,20 +577,22 @@ zebra_rnh_process_static_routes (vrf_id_t vrfid, int family,
}
}
- if (IS_ZEBRA_DEBUG_NHT)
- {
- prefix2str(&static_rn->p, bufs, INET6_ADDRSTRLEN);
- if (prn && rib)
- zlog_debug("%u:%s: NH change %s, scheduling static route %s",
- vrfid, bufn, num_resolving_nh ?
- "" : "(filtered by route-map)", bufs);
- else
- zlog_debug("%u:%s: NH unreachable, scheduling static route %s",
- vrfid, bufn, bufs);
+ if (IS_ZEBRA_DEBUG_NHT)
+ {
+ prefix2str(&static_rn->p, bufs, INET6_ADDRSTRLEN);
+ if (prn && rib)
+ zlog_debug("%u:%s: NH change %s, scheduling static route %s",
+ vrfid, bufn, num_resolving_nh ?
+ "" : "(filtered by route-map)", bufs);
+ else
+ zlog_debug("%u:%s: NH unreachable, scheduling static route %s",
+ vrfid, bufn, bufs);
+ }
+
+ SET_FLAG(srib->status, RIB_ENTRY_CHANGED);
+ SET_FLAG(srib->status, RIB_ENTRY_NEXTHOPS_CHANGED);
}
- SET_FLAG(srib->status, RIB_ENTRY_CHANGED);
- SET_FLAG(srib->status, RIB_ENTRY_NEXTHOPS_CHANGED);
rib_queue_add(static_rn);
}
}