diff --git a/mpls/ldp.c b/mpls/ldp.c index b646490..74ade35 100644 --- a/mpls/ldp.c +++ b/mpls/ldp.c @@ -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; diff --git a/mpls/rsvp.c b/mpls/rsvp.c index a3d23ea..f9367ac 100644 --- a/mpls/rsvp.c +++ b/mpls/rsvp.c @@ -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;