Skip to content

Commit

Permalink
interfaces-plugin: remove unused variables for sysrepo session and co…
Browse files Browse the repository at this point in the history
…nnection
  • Loading branch information
zinccyy committed Oct 11, 2022
1 parent 7d74045 commit 7610ffb
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ int interfaces_interface_ipv4_neighbor_change_link_layer_address(void* priv, sr_

switch (change_ctx->operation) {
case SR_OP_CREATED:
// not used - used only in IP change callback
break;
case SR_OP_MODIFIED:
// change lladdr

break;
case SR_OP_DELETED:
// not used - used only in IP change callback
break;
case SR_OP_MOVED:
break;
Expand All @@ -55,10 +59,6 @@ int interfaces_interface_ipv4_neighbor_change_ip(void* priv, sr_session_ctx_t* s
int error = 0;
void* error_ptr = NULL;

// sysrepo
sr_conn_ctx_t* conn_ctx = NULL;
sr_session_ctx_t* running_session = NULL;

// strings and buffers
const char* node_name = LYD_NAME(change_ctx->node);
const char* node_value = lyd_get_value(change_ctx->node);
Expand Down Expand Up @@ -90,12 +90,6 @@ int interfaces_interface_ipv4_neighbor_change_ip(void* priv, sr_session_ctx_t* s
// get link
SRPC_SAFE_CALL_PTR(current_link, rtnl_link_get_by_name(mod_ctx->nl_ctx.link_cache, interface_name_buffer), error_out);

// get connection
SRPC_SAFE_CALL_PTR(conn_ctx, sr_session_get_connection(session), error_out);

// start a running DS session - fetching data about prefix when deleting the address
SRPC_SAFE_CALL_ERR(error, sr_session_start(conn_ctx, SR_DS_RUNNING, &running_session), error_out);

switch (change_ctx->operation) {
case SR_OP_CREATED:
// new neighbor
Expand Down Expand Up @@ -158,9 +152,6 @@ int interfaces_interface_ipv4_neighbor_change_ip(void* priv, sr_session_ctx_t* s
error = -1;

out:
if (running_session) {
sr_session_stop(running_session);
}

// re-initialize mod_ctx data
if (mod_ctx->mod_data.ipv4.neighbor.link_layer_address) {
Expand Down

0 comments on commit 7610ffb

Please sign in to comment.