return CMD_SUCCESS;
implicit_commit = vty_needs_implicit_commit(vty);
- ret = vty_mgmt_send_config_data(vty);
+ ret = vty_mgmt_send_config_data(vty, implicit_commit);
if (ret >= 0 && !implicit_commit)
vty->mgmt_num_pending_setcfg++;
return ret;
if (vty_mgmt_should_process_cli_apply_changes(vty)) {
VTY_CHECK_XPATH;
-
+ /*
+ * The legacy user wanted to clear pending (i.e., perform a
+ * commit immediately) due to some non-yang compatible
+ * functionality. This new mgmtd code however, continues to send
+ * changes putting off the commit until XFRR_end is received
+ * (i.e., end-of-config-file). This should be fine b/c all
+ * conversions to mgmtd require full proper implementations.
+ */
implicit_commit = vty_needs_implicit_commit(vty);
- ret = vty_mgmt_send_config_data(vty);
+ ret = vty_mgmt_send_config_data(vty, implicit_commit);
if (ret >= 0 && !implicit_commit)
vty->mgmt_num_pending_setcfg++;
return ret;
return 0;
}
-int vty_mgmt_send_config_data(struct vty *vty)
+int vty_mgmt_send_config_data(struct vty *vty, bool implicit_commit)
{
Mgmtd__YangDataValue value[VTY_MAXCFGCHANGES];
Mgmtd__YangData cfg_data[VTY_MAXCFGCHANGES];
Mgmtd__YangCfgDataReq *cfgreq[VTY_MAXCFGCHANGES] = {0};
size_t indx;
int cnt;
- bool implicit_commit = false;
if (vty->type == VTY_FILE) {
/*
}
vty->mgmt_req_id++;
- implicit_commit = vty_needs_implicit_commit(vty);
if (cnt && mgmt_fe_send_setcfg_req(
mgmt_fe_client, vty->mgmt_session_id,
vty->mgmt_req_id, MGMTD_DS_CANDIDATE, cfgreq,
/* Dynamic transaction information. */
bool pending_allowed;
bool pending_commit;
- bool no_implicit_commit;
char *pending_cmds_buf;
size_t pending_cmds_buflen;
size_t pending_cmds_bufpos;
extern bool vty_mgmt_should_process_cli_apply_changes(struct vty *vty);
extern bool mgmt_vty_read_configs(void);
-extern int vty_mgmt_send_config_data(struct vty *vty);
+extern int vty_mgmt_send_config_data(struct vty *vty, bool implicit_commit);
extern int vty_mgmt_send_commit_config(struct vty *vty, bool validate_only,
bool abort);
extern int vty_mgmt_send_get_config(struct vty *vty,
static inline bool vty_needs_implicit_commit(struct vty *vty)
{
- return (frr_get_cli_mode() == FRR_CLI_CLASSIC
- ? ((vty->pending_allowed || vty->no_implicit_commit)
- ? false
- : true)
- : false);
+ return frr_get_cli_mode() == FRR_CLI_CLASSIC && !vty->pending_allowed;
}
#ifdef __cplusplus
vty->cfg_changes[0].operation = NB_OP_CREATE;
vty->num_cfg_changes = 1;
- vty->no_implicit_commit = true;
- vty_mgmt_send_config_data(vty);
- vty->no_implicit_commit = false;
+ vty_mgmt_send_config_data(vty, false);
return CMD_SUCCESS;
}
vty->cfg_changes[0].operation = NB_OP_DESTROY;
vty->num_cfg_changes = 1;
- vty->no_implicit_commit = true;
- vty_mgmt_send_config_data(vty);
- vty->no_implicit_commit = false;
+ vty_mgmt_send_config_data(vty, false);
return CMD_SUCCESS;
}