Skip to content

Commit

Permalink
Bug Fix : Strncpy was being used instead of strncmp. Type error.
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinites committed Feb 11, 2020
1 parent 576b43c commit a3fc648
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mpls/ldp.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ create_targeted_ldp_tunnel(node_t *ingress_lsr, /*Ingress LSR*/

ITERATE_GLTHREAD_BEGIN(&rt_un_entry->nh_list_head, curr){
nexthop = glthread_to_unified_nh(curr);
if(nexthop->oif == oif && !strncpy(nexthop->gw_prefix, gw_ip, PREFIX_LEN) &&
if(nexthop->oif == oif && !strncmp(nexthop->gw_prefix, gw_ip, PREFIX_LEN) &&
nexthop->protocol == LDP_PROTO){
assert(nexthop->nh_node == proxy_nbr);
is_exist = TRUE;
Expand Down
2 changes: 1 addition & 1 deletion mpls/rsvp.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ create_targeted_rsvp_tunnel(node_t *ingress_lsr, /*Ingress

ITERATE_GLTHREAD_BEGIN(&rt_un_entry->nh_list_head, curr){
nexthop = glthread_to_unified_nh(curr);
if(nexthop->oif == oif && !strncpy(nexthop->gw_prefix, gw_ip, PREFIX_LEN) &&
if(nexthop->oif == oif && !strncmp(nexthop->gw_prefix, gw_ip, PREFIX_LEN) &&
nexthop->protocol == RSVP_PROTO){
assert(nexthop->nh_node == proxy_nbr);
is_exist = TRUE;
Expand Down

0 comments on commit a3fc648

Please sign in to comment.