summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces/dpo_face.h
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-plugin/src/faces/dpo_face.h')
-rw-r--r--hicn-plugin/src/faces/dpo_face.h32
1 files changed, 15 insertions, 17 deletions
diff --git a/hicn-plugin/src/faces/dpo_face.h b/hicn-plugin/src/faces/dpo_face.h
index 736c5c926..3bb99ecdb 100644
--- a/hicn-plugin/src/faces/dpo_face.h
+++ b/hicn-plugin/src/faces/dpo_face.h
@@ -135,7 +135,7 @@ always_inline void
hicn_dpo_iface_ip4_add_and_lock (hicn_face_id_t * index,
u8 * hicnb_flags,
const ip4_address_t * nat_addr,
- u32 sw_if, u32 node_index)
+ u32 sw_if, u32 adj_index, u32 node_index)
{
/*All (complete) faces are indexed by remote addess as well */
@@ -144,29 +144,27 @@ hicn_dpo_iface_ip4_add_and_lock (hicn_face_id_t * index,
/* if the face exists, it adds a lock */
hicn_face_t *face =
- hicn_face_get (&ip_address, sw_if, &hicn_face_hashtb);
+ hicn_face_get (&ip_address, sw_if, &hicn_face_hashtb, adj_index);
if (face == NULL)
{
hicn_face_id_t idx;
- hicn_iface_add (&ip_address, sw_if, &idx, DPO_PROTO_IP4);
+ hicn_iface_add (&ip_address, sw_if, &idx, DPO_PROTO_IP4, adj_index);
face = hicn_dpoi_get_from_idx(idx);
- if (nat_addr->as_u32 == 0)
- {
+ face->dpo.dpoi_type = DPO_FIRST;
+ face->dpo.dpoi_proto = DPO_PROTO_IP4;
+ face->dpo.dpoi_index = adj_index;
+ face->dpo.dpoi_next_node = node_index;
+
+ /* if (nat_addr->as_u32 == 0) */
+ /* { */
adj_nbr_walk(face->sw_if,
FIB_PROTOCOL_IP4,
hicn4_iface_adj_walk_cb,
face);
- }
- else
- {
- face->dpo.dpoi_type = DPO_FIRST;
- face->dpo.dpoi_proto = DPO_PROTO_IP4;
- face->dpo.dpoi_index = ~0;
- face->dpo.dpoi_next_node = node_index;
- }
+ /* } */
*hicnb_flags = HICN_BUFFER_FLAGS_DEFAULT;
@@ -226,23 +224,23 @@ always_inline void
hicn_dpo_iface_ip6_add_and_lock (hicn_face_id_t * index,
u8 * hicnb_flags,
const ip6_address_t * nat_addr,
- u32 sw_if, u32 node_index)
+ u32 sw_if, u32 adj_index, u32 node_index)
{
/*All (complete) faces are indexed by remote addess as well */
/* if the face exists, it adds a lock */
hicn_face_t *face =
- hicn_face_get ((ip46_address_t *)nat_addr, sw_if, &hicn_face_hashtb);
+ hicn_face_get ((ip46_address_t *)nat_addr, sw_if, &hicn_face_hashtb, adj_index);
if (face == NULL)
{
hicn_face_id_t idx;
- hicn_iface_add ((ip46_address_t *) nat_addr, sw_if, &idx, DPO_PROTO_IP6);
+ hicn_iface_add ((ip46_address_t *) nat_addr, sw_if, &idx, DPO_PROTO_IP6, adj_index);
face = hicn_dpoi_get_from_idx(idx);
face->dpo.dpoi_type = DPO_FIRST;
face->dpo.dpoi_proto = DPO_PROTO_IP6;
- face->dpo.dpoi_index = ~0;
+ face->dpo.dpoi_index = adj_index;
face->dpo.dpoi_next_node = node_index;
//if (ip46_address_is_zero((ip46_address_t *)nat_addr))