aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces/app
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-plugin/src/faces/app')
-rw-r--r--hicn-plugin/src/faces/app/face_cons.c22
-rw-r--r--hicn-plugin/src/faces/app/face_prod.c18
2 files changed, 20 insertions, 20 deletions
diff --git a/hicn-plugin/src/faces/app/face_cons.c b/hicn-plugin/src/faces/app/face_cons.c
index f258da787..e51201c21 100644
--- a/hicn-plugin/src/faces/app/face_cons.c
+++ b/hicn-plugin/src/faces/app/face_cons.c
@@ -73,10 +73,7 @@ hicn_face_cons_add (ip4_address_t * nh_addr4, ip6_address_t * nh_addr6,
face = hicn_dpoi_get_from_idx (*faceid2);
face->shared.flags |= HICN_FACE_FLAGS_APPFACE_CONS;
- return vnet_feature_enable_disable ("ip6-unicast",
- "hicn-iface-ip6-input", swif, 1, 0,
- 0) ==
- 0 ? HICN_ERROR_NONE : HICN_ERROR_APPFACE_FEATURE;
+ return HICN_ERROR_NONE;
}
int
@@ -89,13 +86,7 @@ hicn_face_cons_del (hicn_face_id_t face_id)
if (face->shared.flags & HICN_FACE_FLAGS_APPFACE_CONS)
{
- int ret = hicn_face_ip_del (face_id);
-
- return ret ==
- HICN_ERROR_NONE
- ? (vnet_feature_enable_disable
- ("ip6-unicast", "hicn-iface-ip6-input", face->shared.sw_if, 0,
- 0, 0) == 0 ? HICN_ERROR_NONE : HICN_ERROR_APPFACE_FEATURE) : ret;
+ return hicn_face_ip_del (face_id);
}
else
{
@@ -114,15 +105,6 @@ format_hicn_face_cons (u8 * s, va_list * args)
return s;
}
-/* *INDENT-OFF* */
-VNET_FEATURE_INIT(hicn_cons_app, static)=
-{
- .arc_name = "ip6-unicast",
- .node_name = "hicn-iface-ip6-input",
- .runs_before = VNET_FEATURES("ip6-inacl"),
-};
-/* *INDENT-ON* */
-
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/hicn-plugin/src/faces/app/face_prod.c b/hicn-plugin/src/faces/app/face_prod.c
index c183d6589..ae59719ce 100644
--- a/hicn-plugin/src/faces/app/face_prod.c
+++ b/hicn-plugin/src/faces/app/face_prod.c
@@ -271,6 +271,24 @@ hicn_face_prod_add (fib_prefix_t * prefix, u32 sw_if, u32 * cs_reserved,
if (ret == HICN_ERROR_NONE
&& hicn_face_prod_set_lru_max (*faceid, cs_reserved) == HICN_ERROR_NONE)
{
+ if (ip46_address_is_ip4(&(prefix->fp_addr)))
+ {
+ ip4_address_t mask;
+ ip4_preflen_to_mask (prefix->fp_len, &mask);
+ prefix->fp_addr.ip4.as_u32 = prefix->fp_addr.ip4.as_u32 & mask.as_u32;
+ prefix->fp_proto = FIB_PROTOCOL_IP4;
+ }
+ else
+ {
+ ip6_address_t mask;
+ ip6_preflen_to_mask (prefix->fp_len, &mask);
+ prefix->fp_addr.ip6.as_u64[0] =
+ prefix->fp_addr.ip6.as_u64[0] & mask.as_u64[0];
+ prefix->fp_addr.ip6.as_u64[1] =
+ prefix->fp_addr.ip6.as_u64[1] & mask.as_u64[1];
+ prefix->fp_proto = FIB_PROTOCOL_IP6;
+ }
+
hicn_app_state_create (sw_if, prefix);
ret = hicn_route_add (faceid, 1, prefix);
}