diff options
Diffstat (limited to 'hicn-light')
-rw-r--r-- | hicn-light/src/hicn/core/forwarder.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/hicn-light/src/hicn/core/forwarder.c b/hicn-light/src/hicn/core/forwarder.c index 482e3d6f1..14f1649fa 100644 --- a/hicn-light/src/hicn/core/forwarder.c +++ b/hicn-light/src/hicn/core/forwarder.c @@ -790,9 +790,18 @@ static interest_manifest_header_t *_forwarder_get_interest_manifest( if (payload_type != HPT_MANIFEST) return NULL; rc = hicn_packet_get_payload(pkbuf, &payload, &payload_size, false); - _ASSERT(rc == HICN_LIB_ERROR_NONE); + assert(rc == HICN_LIB_ERROR_NONE); + + interest_manifest_header_t *int_manifest_header = + (interest_manifest_header_t *)payload; - return (interest_manifest_header_t *)payload; + // Deserialize intrest mmanifest + interest_manifest_deserialize(int_manifest_header); + + if (!interest_manifest_is_valid(int_manifest_header, payload_size)) + return NULL; + + return int_manifest_header; } // Manifest is split using splitting strategy, then every @@ -901,6 +910,9 @@ int _forwarder_forward_aggregated_interest( { pit_entry_egress_add(pit_entry, nexthop); }); } + // Serialize manifest before sending it + interest_manifest_serialize(int_manifest_header); + if (forwarder_forward_to_nexthops(forwarder, msgbuf_id, nexthops) <= 0) { ERROR("Message %p returned an empty next hop set", msgbuf); |