aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2018-07-03 01:41:53 +0200
committerAlberto Compagno <acompagn+fdio@cisco.com>2018-07-02 23:46:35 +0000
commit7ec7392541f789bb4115dc9a3406656db904cd3f (patch)
treebbad282d8e81d25aee126e765018bfdc6f0ddd3e
parent2e76ee506d2f1f9f6d8a7902c57c66ea224ca1a4 (diff)
Fixed bug in multiloop pgen servercicn-plugin/master
Change-Id: Ib3cc4b0e8dbf0a28f407ff0b8ca170196bfe5652 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
-rw-r--r--cicn-plugin/cicn/cicn_pg.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/cicn-plugin/cicn/cicn_pg.c b/cicn-plugin/cicn/cicn_pg.c
index 1e25476..7d62cfe 100644
--- a/cicn-plugin/cicn/cicn_pg.c
+++ b/cicn-plugin/cicn/cicn_pg.c
@@ -608,7 +608,6 @@ icnpg_node_server_fn (vlib_main_t * vm,
/* Change message and packet from Interest to Content */
*(body0 + 1) = CICN_PKT_TYPE_CONTENT;
- C_PUTINT16 (body0 + 14, CICN_MSG_TYPE_CONTENT);
vlib_buffer_t *rb = NULL;
rb = vlib_get_buffer (vm, sm->pgen_svr_buffer_idx);
@@ -642,6 +641,7 @@ icnpg_node_server_fn (vlib_main_t * vm,
// Update interest lifetime to cache time
C_PUTINT16 (body0 + 8, CICN_HDR_TLV_CACHE_TIME);
+ C_PUTINT16 (body0 + 14, CICN_MSG_TYPE_CONTENT);
// Update the length of the message
uint16_t msg_len;
C_GETINT16 (msg_len, body0 + 16);
@@ -689,7 +689,6 @@ icnpg_node_server_fn (vlib_main_t * vm,
/* Change message and packet types from Interest to Content */
*(body1 + 1) = CICN_PKT_TYPE_CONTENT;
- C_PUTINT16 (body1 + 14, CICN_MSG_TYPE_CONTENT);
vlib_buffer_t *rb = NULL;
rb = vlib_get_buffer (vm, sm->pgen_svr_buffer_idx);
@@ -723,6 +722,7 @@ icnpg_node_server_fn (vlib_main_t * vm,
// Update interest lifetime to cache time
C_PUTINT16 (body1 + 8, CICN_HDR_TLV_CACHE_TIME);
+ C_PUTINT16 (body1 + 14, CICN_MSG_TYPE_CONTENT);
// Update the length of the message
uint16_t msg_len;
C_GETINT16 (msg_len, body1 + 16);
@@ -841,7 +841,6 @@ icnpg_node_server_fn (vlib_main_t * vm,
/* Change message and packet types from Interest to Content */
*(body0 + 1) = CICN_PKT_TYPE_CONTENT;
- C_PUTINT16 (body0 + 8, CICN_MSG_TYPE_CONTENT);
vlib_buffer_t *rb = NULL;
rb = vlib_get_buffer (vm, sm->pgen_svr_buffer_idx);
@@ -872,10 +871,14 @@ icnpg_node_server_fn (vlib_main_t * vm,
b0 = vlib_get_buffer (vm, index);
body0 = vlib_buffer_get_current (b0);
+ // Update interest lifetime to cache time
+ C_PUTINT16 (body0 + 8, CICN_HDR_TLV_CACHE_TIME);
+
+ C_PUTINT16 (body0 + 14, CICN_MSG_TYPE_CONTENT);
// Update the length of the message
uint16_t msg_len;
- C_GETINT16 (msg_len, body0 + 10);
- C_PUTINT16 (body0 + 10, msg_len + bytes_to_copy);
+ C_GETINT16 (msg_len, body0 + 16);
+ C_PUTINT16 (body0 + 16, msg_len + bytes_to_copy);
// Update the length of the packet
C_PUTINT16 (body0 + 2, pkt_len + bytes_to_copy);