* the ecommunity parser.
*/
if ((argv[i]->arg)[0] == '*') {
- if (!is_import) {
- vty_out(vty,
- "%% Wildcard '*' only applicable for import\n");
- ret = CMD_WARNING;
- continue;
- }
-
(argv[i]->arg)[0] = '0';
is_wildcard = true;
}
return CMD_WARNING_CONFIG_FAILED;
}
+ if (rt_type != RT_TYPE_IMPORT) {
+ for (int i = 2; i < argc; i++) {
+ if ((argv[i]->arg)[0] == '*') {
+ vty_out(vty,
+ "%% Wildcard '*' only applicable for import\n");
+ return CMD_WARNING_CONFIG_FAILED;
+ }
+ }
+ }
+
/* Add/update the import route-target */
if (rt_type == RT_TYPE_BOTH || rt_type == RT_TYPE_IMPORT)
tmp_ret = parse_rtlist(bgp, vty, argc, argv, 2, true, true);
}
}
+ if (rt_type != RT_TYPE_IMPORT) {
+ for (int i = 3; i < argc; i++) {
+ if ((argv[i]->arg)[0] == '*') {
+ vty_out(vty,
+ "%% Wildcard '*' only applicable for import\n");
+ return CMD_WARNING_CONFIG_FAILED;
+ }
+ }
+ }
+
if (rt_type == RT_TYPE_BOTH || rt_type == RT_TYPE_IMPORT)
tmp_ret = parse_rtlist(bgp, vty, argc, argv, 3, false, true);
{
intmax_t delta;
uint32_t holdtime;
+ intmax_t sendholdtime;
frr_with_mutex (&peer->io_mtx) {
/* if the queue is empty, reset the "last OK" timestamp to
stream_fifo_push(peer->obuf, s);
delta = monotime(NULL) - peer->last_sendq_ok;
- holdtime = atomic_load_explicit(&peer->holdtime,
- memory_order_relaxed);
+
+ if (CHECK_FLAG(peer->flags, PEER_FLAG_TIMER))
+ holdtime = atomic_load_explicit(&peer->holdtime,
+ memory_order_relaxed);
+ else
+ holdtime = peer->bgp->default_holdtime;
+
+ sendholdtime = holdtime * 2;
/* Note that when we're here, we're adding some packet to the
* OutQ. That includes keepalives when there is nothing to
*/
if (!holdtime) {
/* no holdtime, do nothing. */
- } else if (delta > 2 * (intmax_t)holdtime) {
+ } else if (delta > sendholdtime) {
flog_err(
EC_BGP_SENDQ_STUCK_PROPER,
- "%s has not made any SendQ progress for 2 holdtimes, terminating session",
- peer->host);
+ "%pBP has not made any SendQ progress for 2 holdtimes (%jds), terminating session",
+ peer, sendholdtime);
BGP_EVENT_ADD(peer, TCP_fatal_error);
} else if (delta > (intmax_t)holdtime &&
monotime(NULL) - peer->last_sendq_warn > 5) {
flog_warn(
EC_BGP_SENDQ_STUCK_WARN,
- "%s has not made any SendQ progress for 1 holdtime, peer overloaded?",
- peer->host);
+ "%pBP has not made any SendQ progress for 1 holdtime (%us), peer overloaded?",
+ peer, holdtime);
peer->last_sendq_warn = monotime(NULL);
}
}
bool force_evpn_import = false;
safi_t orig_safi = safi;
bool leak_success = true;
+ int allowas_in = 0;
if (frrtrace_enabled(frr_bgp, process_update)) {
char pfxprint[PREFIX2STR_BUFFER];
&& peer != bgp->peer_self)
bgp_adj_in_set(dest, peer, attr, addpath_id);
+ /* Update permitted loop count */
+ if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_ALLOWAS_IN))
+ allowas_in = peer->allowas_in[afi][safi];
+
/* Check previously received route. */
for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next)
if (pi->peer == peer && pi->type == type
/* AS path local-as loop check. */
if (peer->change_local_as) {
- if (peer->allowas_in[afi][safi])
- aspath_loop_count = peer->allowas_in[afi][safi];
+ if (allowas_in)
+ aspath_loop_count = allowas_in;
else if (!CHECK_FLAG(peer->flags,
PEER_FLAG_LOCAL_AS_NO_PREPEND))
aspath_loop_count = 1;
/* AS path loop check. */
if (do_loop_check) {
- if (aspath_loop_check(attr->aspath, bgp->as)
- > peer->allowas_in[afi][safi]
- || (CHECK_FLAG(bgp->config, BGP_CONFIG_CONFEDERATION)
- && aspath_loop_check(attr->aspath, bgp->confed_id)
- > peer->allowas_in[afi][safi])) {
+ if (aspath_loop_check(attr->aspath, bgp->as) > allowas_in ||
+ (CHECK_FLAG(bgp->config, BGP_CONFIG_CONFEDERATION) &&
+ (aspath_loop_check(attr->aspath, bgp->confed_id) >
+ allowas_in))) {
peer->stat_pfx_aspath_loop++;
reason = "as-path contains our own AS;";
goto filtered;
json_addr,
"privateAsNumsRemovedInUpdatesToNbr");
+ if (CHECK_FLAG(p->af_flags[afi][safi], PEER_FLAG_ALLOWAS_IN)) {
+ if (CHECK_FLAG(p->af_flags[afi][safi],
+ PEER_FLAG_ALLOWAS_IN_ORIGIN))
+ json_object_boolean_true_add(json_addr,
+ "allowAsInOrigin");
+ else
+ json_object_int_add(json_addr, "allowAsInCount",
+ p->allowas_in[afi][safi]);
+ }
+
if (p->addpath_type[afi][safi] != BGP_ADDPATH_NONE)
json_object_boolean_true_add(
json_addr,
vty_out(vty,
" Private AS numbers removed in updates to this neighbor\n");
+ if (CHECK_FLAG(p->af_flags[afi][safi], PEER_FLAG_ALLOWAS_IN)) {
+ if (CHECK_FLAG(p->af_flags[afi][safi],
+ PEER_FLAG_ALLOWAS_IN_ORIGIN))
+ vty_out(vty,
+ " Local AS allowed as path origin\n");
+ else
+ vty_out(vty,
+ " Local AS allowed in path, %d occurrences\n",
+ p->allowas_in[afi][safi]);
+ }
+
if (p->addpath_type[afi][safi] != BGP_ADDPATH_NONE)
vty_out(vty, " %s\n",
bgp_addpath_names(p->addpath_type[afi][safi])
{PEER_FLAG_TIMER_CONNECT, 0, peer_change_none},
{PEER_FLAG_TIMER_DELAYOPEN, 0, peer_change_none},
{PEER_FLAG_PASSWORD, 0, peer_change_none},
- {PEER_FLAG_LOCAL_AS, 0, peer_change_none},
- {PEER_FLAG_LOCAL_AS_NO_PREPEND, 0, peer_change_none},
- {PEER_FLAG_LOCAL_AS_REPLACE_AS, 0, peer_change_none},
+ {PEER_FLAG_LOCAL_AS, 0, peer_change_reset},
+ {PEER_FLAG_LOCAL_AS_NO_PREPEND, 0, peer_change_reset},
+ {PEER_FLAG_LOCAL_AS_REPLACE_AS, 0, peer_change_reset},
{PEER_FLAG_UPDATE_SOURCE, 0, peer_change_none},
{PEER_FLAG_DISABLE_LINK_BW_ENCODING_IEEE, 0, peer_change_none},
{PEER_FLAG_EXTENDED_OPT_PARAMS, 0, peer_change_reset},
(void)peer_sort(peer);
/* Check if handling a regular peer. */
- if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) {
- /* Send notification or reset peer depending on state. */
- if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status)) {
- peer->last_reset = PEER_DOWN_LOCAL_AS_CHANGE;
- bgp_notify_send(peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
- } else
- bgp_session_reset(peer);
-
- /* Skip peer-group mechanics for regular peers. */
+ if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP))
return 0;
- }
/*
* Set flag and configuration on all peer-group members, unless they are
COND_FLAG(member->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS,
replace_as);
member->change_local_as = as;
-
- /* Send notification or stop peer depending on state. */
- if (BGP_IS_VALID_STATE_FOR_NOTIF(member->status)) {
- member->last_reset = PEER_DOWN_LOCAL_AS_CHANGE;
- bgp_notify_send(member, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_CONFIG_CHANGE);
- } else
- BGP_EVENT_ADD(member, BGP_Stop);
}
return 0;
DEFINE_MTYPE_STATIC(ISISD, ISIS_MPLS_TE, "ISIS MPLS_TE parameters");
+static void isis_mpls_te_circuit_ip_update(struct isis_circuit *circuit);
+
/*------------------------------------------------------------------------*
* Following are control functions for MPLS-TE parameters management.
*------------------------------------------------------------------------*/
if (area->mta->ted)
isis_te_init_ted(area);
- /* Update Extended TLVs according to Interface link parameters */
- for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit))
+ /* Update Extended TLVs according to Interface link parameters
+ * and neighbor IP addresses
+ */
+ for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) {
isis_link_params_update(circuit, circuit->interface);
+ isis_mpls_te_circuit_ip_update(circuit);
+ }
}
/**
area->mta->status = disable;
/* Remove Link State Database */
- ls_ted_del_all(&area->mta->ted);
+ ls_ted_clean(area->mta->ted);
/* Disable Extended SubTLVs on all circuit */
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) {
return;
}
-static int isis_mpls_te_adj_ip_enabled(struct isis_adjacency *adj, int family,
- bool global)
+static int _isis_mpls_te_adj_ip_enabled(struct isis_adjacency *adj, int family,
+ bool global)
{
struct isis_circuit *circuit;
struct isis_ext_subtlvs *ext;
- /* Sanity Check */
- if (!adj || !adj->circuit)
- return 0;
-
circuit = adj->circuit;
/* Check that MPLS TE is enabled */
}
break;
case AF_INET6:
+ /* Nothing to do for link-local addresses - ie. not global.
+ * https://datatracker.ietf.org/doc/html/rfc6119#section-3.1.1
+ * Because the IPv6 traffic engineering TLVs present in LSPs are
+ * propagated across networks, they MUST NOT use link-local
+ * addresses.
+ */
if (!global)
return 0;
return 0;
}
- /* Update LSP */
- lsp_regenerate_schedule(circuit->area, circuit->is_type, 0);
-
return 0;
}
-static int isis_mpls_te_adj_ip_disabled(struct isis_adjacency *adj, int family,
- bool global)
+static int isis_mpls_te_adj_ip_enabled(struct isis_adjacency *adj, int family,
+ bool global)
{
- struct isis_circuit *circuit;
- struct isis_ext_subtlvs *ext;
+ int ret;
/* Sanity Check */
- if (!adj || !adj->circuit || !adj->circuit->ext)
+ if (!adj || !adj->circuit)
return 0;
+ ret = _isis_mpls_te_adj_ip_enabled(adj, family, global);
+
+ /* Update LSP */
+ lsp_regenerate_schedule(adj->circuit->area, adj->circuit->is_type, 0);
+
+ return ret;
+}
+
+static int _isis_mpls_te_adj_ip_disabled(struct isis_adjacency *adj, int family,
+ bool global)
+{
+ struct isis_circuit *circuit;
+ struct isis_ext_subtlvs *ext;
+
circuit = adj->circuit;
/* Check that MPLS TE is enabled */
return 0;
}
+ return 0;
+}
+
+static int isis_mpls_te_adj_ip_disabled(struct isis_adjacency *adj, int family,
+ bool global)
+{
+ int ret;
+
+ /* Sanity Check */
+ if (!adj || !adj->circuit || !adj->circuit->ext)
+ return 0;
+
+ ret = _isis_mpls_te_adj_ip_disabled(adj, family, global);
+
/* Update LSP */
- lsp_regenerate_schedule(circuit->area, circuit->is_type, 0);
+ lsp_regenerate_schedule(adj->circuit->area, adj->circuit->is_type, 0);
- return 0;
+ return ret;
}
+static void isis_mpls_te_circuit_ip_update(struct isis_circuit *circuit)
+{
+ struct isis_adjacency *adj;
+
+ /* https://datatracker.ietf.org/doc/html/rfc6119#section-3.2.3
+ * This sub-TLV of the Extended IS Reachability TLV is used for point-
+ * to-point links
+ */
+ if (circuit->circ_type != CIRCUIT_T_P2P)
+ return;
+
+ adj = circuit->u.p2p.neighbor;
+
+ if (!adj)
+ return;
+
+ /* Nothing to do for link-local addresses.
+ * https://datatracker.ietf.org/doc/html/rfc6119#section-3.1.1
+ * Because the IPv6 traffic engineering TLVs present in LSPs are
+ * propagated across networks, they MUST NOT use link-local addresses.
+ */
+ if (adj->ipv4_address_count > 0)
+ _isis_mpls_te_adj_ip_enabled(adj, AF_INET, false);
+ else
+ _isis_mpls_te_adj_ip_disabled(adj, AF_INET, false);
+
+ if (adj->global_ipv6_count > 0)
+ _isis_mpls_te_adj_ip_enabled(adj, AF_INET6, true);
+ else
+ _isis_mpls_te_adj_ip_disabled(adj, AF_INET6, true);
+}
+
+
int isis_mpls_te_update(struct interface *ifp)
{
struct isis_circuit *circuit;
struct if_link_params *if_link_params_get(struct interface *ifp)
{
- int i;
+ return ifp->link_params;
+}
- if (ifp->link_params != NULL)
- return ifp->link_params;
+struct if_link_params *if_link_params_enable(struct interface *ifp)
+{
+ struct if_link_params *iflp;
+ int i;
- struct if_link_params *iflp =
- XCALLOC(MTYPE_IF_LINK_PARAMS, sizeof(struct if_link_params));
+ iflp = if_link_params_init(ifp);
/* Compute default bandwidth based on interface */
iflp->default_bw =
return iflp;
}
+struct if_link_params *if_link_params_init(struct interface *ifp)
+{
+ struct if_link_params *iflp = if_link_params_get(ifp);
+
+ if (iflp)
+ return iflp;
+
+ iflp = XCALLOC(MTYPE_IF_LINK_PARAMS, sizeof(struct if_link_params));
+
+ ifp->link_params = iflp;
+
+ return iflp;
+}
+
void if_link_params_free(struct interface *ifp)
{
XFREE(MTYPE_IF_LINK_PARAMS, ifp->link_params);
/* link parameters */
struct if_link_params *if_link_params_get(struct interface *);
+struct if_link_params *if_link_params_enable(struct interface *ifp);
+struct if_link_params *if_link_params_init(struct interface *ifp);
void if_link_params_free(struct interface *);
/* Northbound. */
return 0;
}
-static int link_params_set_value(struct stream *s, struct if_link_params *iflp)
+static int link_params_set_value(struct stream *s, struct interface *ifp)
{
+ uint8_t link_params_enabled;
+ struct if_link_params *iflp;
+ uint32_t bwclassnum;
+
+ iflp = if_link_params_get(ifp);
if (iflp == NULL)
- return -1;
+ iflp = if_link_params_init(ifp);
- uint32_t bwclassnum;
+ STREAM_GETC(s, link_params_enabled);
+ if (!link_params_enabled) {
+ if_link_params_free(ifp);
+ return 0;
+ }
STREAM_GETL(s, iflp->lp_status);
STREAM_GETL(s, iflp->te_metric);
bool *changed)
{
struct if_link_params *iflp;
- struct if_link_params iflp_copy;
+ struct if_link_params iflp_prev;
ifindex_t ifindex;
- bool params_changed = false;
+ bool iflp_prev_set;
STREAM_GETL(s, ifindex);
return NULL;
}
- if (ifp->link_params == NULL)
- params_changed = true;
-
- if ((iflp = if_link_params_get(ifp)) == NULL)
- return NULL;
-
- memcpy(&iflp_copy, iflp, sizeof(iflp_copy));
+ iflp = if_link_params_get(ifp);
+ if (iflp) {
+ iflp_prev_set = true;
+ memcpy(&iflp_prev, ifp->link_params, sizeof(iflp_prev));
+ } else
+ iflp_prev_set = false;
- if (link_params_set_value(s, iflp) != 0)
+ /* read the link_params from stream
+ * Free ifp->link_params if the stream has no params
+ * to means that link-params are not enabled on links.
+ */
+ if (link_params_set_value(s, ifp) != 0)
goto stream_failure;
- if (memcmp(&iflp_copy, iflp, sizeof(iflp_copy)))
- params_changed = true;
+ if (changed == NULL)
+ return ifp;
- if (changed)
- *changed = params_changed;
+ if (iflp_prev_set && iflp) {
+ if (memcmp(&iflp_prev, iflp, sizeof(iflp_prev)))
+ *changed = true;
+ else
+ *changed = false;
+ } else if (!iflp_prev_set && !iflp)
+ *changed = false;
+ else
+ *changed = true;
return ifp;
/* Read Traffic Engineering status */
link_params_status = stream_getc(s);
/* Then, Traffic Engineering parameters if any */
- if (link_params_status) {
- struct if_link_params *iflp = if_link_params_get(ifp);
- link_params_set_value(s, iflp);
- }
+ if (link_params_status)
+ link_params_set_value(s, ifp);
nexthop_group_interface_state_change(ifp, old_ifindex);
struct if_link_params *iflp;
int i;
- if (s == NULL || ifp == NULL || ifp->link_params == NULL)
+ if (s == NULL || ifp == NULL)
return 0;
iflp = ifp->link_params;
w = 0;
+ /* encode if link_params is enabled */
+ if (iflp) {
+ w += stream_putc(s, true);
+ } else {
+ w += stream_putc(s, false);
+ return w;
+ }
+
w += stream_putl(s, iflp->lp_status);
w += stream_putl(s, iflp->te_metric);
*/
void vtysh_config_write(void)
{
+ const char *name;
char line[512];
- if (cmd_hostname_get()) {
- snprintf(line, sizeof(line), "hostname %s", cmd_hostname_get());
+ name = cmd_hostname_get();
+ if (name && name[0] != '\0') {
+ snprintf(line, sizeof(line), "hostname %s", name);
vtysh_config_parse_line(NULL, line);
}
- if (cmd_domainname_get()) {
- snprintf(line, sizeof(line), "domainname %s",
- cmd_domainname_get());
+ name = cmd_domainname_get();
+ if (name && name[0] != '\0') {
+ snprintf(line, sizeof(line), "domainname %s", name);
vtysh_config_parse_line(NULL, line);
}
+
if (vtysh_write_integrated == WRITE_INTEGRATED_NO)
vtysh_config_parse_line(NULL,
"no service integrated-vtysh-config");
"Link-params: enable TE link parameters on interface %s",
ifp->name);
- if (!if_link_params_get(ifp)) {
- if (IS_ZEBRA_DEBUG_EVENT || IS_ZEBRA_DEBUG_MPLS)
- zlog_debug(
- "Link-params: failed to init TE link parameters %s",
- ifp->name);
-
- return CMD_WARNING_CONFIG_FAILED;
- }
+ if (!if_link_params_get(ifp))
+ if_link_params_enable(ifp);
/* force protocols to update LINK STATE due to parameters change */
if (if_is_operative(ifp))
metric = strtoul(argv[idx_number]->arg, NULL, 10);
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update TE metric if needed */
link_param_cmd_set_uint32(ifp, &iflp->te_metric, LP_TE_METRIC, metric);
/* Check that Maximum bandwidth is not lower than other bandwidth
* parameters */
- if ((bw <= iflp->max_rsv_bw) || (bw <= iflp->unrsv_bw[0])
- || (bw <= iflp->unrsv_bw[1]) || (bw <= iflp->unrsv_bw[2])
- || (bw <= iflp->unrsv_bw[3]) || (bw <= iflp->unrsv_bw[4])
- || (bw <= iflp->unrsv_bw[5]) || (bw <= iflp->unrsv_bw[6])
- || (bw <= iflp->unrsv_bw[7]) || (bw <= iflp->ava_bw)
- || (bw <= iflp->res_bw) || (bw <= iflp->use_bw)) {
+ if (iflp && ((bw <= iflp->max_rsv_bw) || (bw <= iflp->unrsv_bw[0]) ||
+ (bw <= iflp->unrsv_bw[1]) || (bw <= iflp->unrsv_bw[2]) ||
+ (bw <= iflp->unrsv_bw[3]) || (bw <= iflp->unrsv_bw[4]) ||
+ (bw <= iflp->unrsv_bw[5]) || (bw <= iflp->unrsv_bw[6]) ||
+ (bw <= iflp->unrsv_bw[7]) || (bw <= iflp->ava_bw) ||
+ (bw <= iflp->res_bw) || (bw <= iflp->use_bw))) {
vty_out(vty,
"Maximum Bandwidth could not be lower than others bandwidth\n");
return CMD_WARNING_CONFIG_FAILED;
}
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update Maximum Bandwidth if needed */
link_param_cmd_set_float(ifp, &iflp->max_bw, LP_MAX_BW, bw);
/* Check that bandwidth is not greater than maximum bandwidth parameter
*/
- if (bw > iflp->max_bw) {
+ if (iflp && bw > iflp->max_bw) {
vty_out(vty,
"Maximum Reservable Bandwidth could not be greater than Maximum Bandwidth (%g)\n",
iflp->max_bw);
return CMD_WARNING_CONFIG_FAILED;
}
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update Maximum Reservable Bandwidth if needed */
link_param_cmd_set_float(ifp, &iflp->max_rsv_bw, LP_MAX_RSV_BW, bw);
/* Check that bandwidth is not greater than maximum bandwidth parameter
*/
- if (bw > iflp->max_bw) {
+ if (iflp && bw > iflp->max_bw) {
vty_out(vty,
"UnReserved Bandwidth could not be greater than Maximum Bandwidth (%g)\n",
iflp->max_bw);
return CMD_WARNING_CONFIG_FAILED;
}
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update Unreserved Bandwidth if needed */
link_param_cmd_set_float(ifp, &iflp->unrsv_bw[priority], LP_UNRSV_BW,
bw);
return CMD_WARNING_CONFIG_FAILED;
}
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update Administrative Group if needed */
link_param_cmd_set_uint32(ifp, &iflp->admin_grp, LP_ADM_GRP, value);
return CMD_WARNING_CONFIG_FAILED;
}
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
as = strtoul(argv[idx_number]->arg, NULL, 10);
/* Update Remote IP and Remote AS fields if needed */
VTY_DECLVAR_CONTEXT(interface, ifp);
struct if_link_params *iflp = if_link_params_get(ifp);
+ if (!iflp)
+ return CMD_SUCCESS;
+
/* Reset Remote IP and AS neighbor */
iflp->rmt_as = 0;
iflp->rmt_ip.s_addr = 0;
* Therefore, it is also allowed that the average
* delay be equal to the min delay or max delay.
*/
- if (IS_PARAM_SET(iflp, LP_MM_DELAY)
- && (delay < iflp->min_delay || delay > iflp->max_delay)) {
+ if (iflp && IS_PARAM_SET(iflp, LP_MM_DELAY) &&
+ (delay < iflp->min_delay || delay > iflp->max_delay)) {
vty_out(vty,
"Average delay should be in range Min (%d) - Max (%d) delay\n",
iflp->min_delay, iflp->max_delay);
return CMD_WARNING_CONFIG_FAILED;
}
+
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update delay if value is not set or change */
if (IS_PARAM_UNSET(iflp, LP_DELAY) || iflp->av_delay != delay) {
iflp->av_delay = delay;
low, high);
return CMD_WARNING_CONFIG_FAILED;
}
+
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update Delays if needed */
if (IS_PARAM_UNSET(iflp, LP_DELAY)
|| IS_PARAM_UNSET(iflp, LP_MM_DELAY)
VTY_DECLVAR_CONTEXT(interface, ifp);
struct if_link_params *iflp = if_link_params_get(ifp);
+ if (!iflp)
+ return CMD_SUCCESS;
+
/* Unset Delays */
iflp->av_delay = 0;
UNSET_PARAM(iflp, LP_DELAY);
value = strtoul(argv[idx_number]->arg, NULL, 10);
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update Delay Variation if needed */
link_param_cmd_set_uint32(ifp, &iflp->delay_var, LP_DELAY_VAR, value);
if (fval > MAX_PKT_LOSS)
fval = MAX_PKT_LOSS;
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update Packet Loss if needed */
link_param_cmd_set_float(ifp, &iflp->pkt_loss, LP_PKT_LOSS, fval);
/* Check that bandwidth is not greater than maximum bandwidth parameter
*/
- if (bw > iflp->max_bw) {
+ if (iflp && bw > iflp->max_bw) {
vty_out(vty,
"Residual Bandwidth could not be greater than Maximum Bandwidth (%g)\n",
iflp->max_bw);
return CMD_WARNING_CONFIG_FAILED;
}
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update Residual Bandwidth if needed */
link_param_cmd_set_float(ifp, &iflp->res_bw, LP_RES_BW, bw);
/* Check that bandwidth is not greater than maximum bandwidth parameter
*/
- if (bw > iflp->max_bw) {
+ if (iflp && bw > iflp->max_bw) {
vty_out(vty,
"Available Bandwidth could not be greater than Maximum Bandwidth (%g)\n",
iflp->max_bw);
return CMD_WARNING_CONFIG_FAILED;
}
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update Residual Bandwidth if needed */
link_param_cmd_set_float(ifp, &iflp->ava_bw, LP_AVA_BW, bw);
/* Check that bandwidth is not greater than maximum bandwidth parameter
*/
- if (bw > iflp->max_bw) {
+ if (iflp && bw > iflp->max_bw) {
vty_out(vty,
"Utilised Bandwidth could not be greater than Maximum Bandwidth (%g)\n",
iflp->max_bw);
return CMD_WARNING_CONFIG_FAILED;
}
+ if (!iflp)
+ iflp = if_link_params_enable(ifp);
+
/* Update Utilized Bandwidth if needed */
link_param_cmd_set_float(ifp, &iflp->use_bw, LP_USE_BW, bw);
{
struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ);
- if (!ifp->link_params) {
- stream_free(s);
- return 0;
- }
-
zclient_create_header(s, ZEBRA_INTERFACE_LINK_PARAMS, ifp->vrf->vrf_id);
/* Add Interface Index */