diff options
author | dimitri staessens <dimitri.staessens@ugent.be> | 2017-04-28 16:17:44 +0000 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2017-04-28 16:17:44 +0000 |
commit | c22d449283b94be89815d586926aaf7baf1c1593 (patch) | |
tree | 50e15983363c163164362851d91c3b6f9511e408 /src/ipcpd/normal/dt_pci.c | |
parent | 72e8f778024ece5c8025be4767ce89eae349f4b5 (diff) | |
parent | 41b73370dba4105ae183babe8f89480e8c9d038a (diff) | |
download | ouroboros-c22d449283b94be89815d586926aaf7baf1c1593.tar.gz ouroboros-c22d449283b94be89815d586926aaf7baf1c1593.zip |
Merged in dstaesse/ouroboros/be-normal-split (pull request #499)
ipcpd: Fix some bugs for the normal split
Diffstat (limited to 'src/ipcpd/normal/dt_pci.c')
-rw-r--r-- | src/ipcpd/normal/dt_pci.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ipcpd/normal/dt_pci.c b/src/ipcpd/normal/dt_pci.c index 0e596803..39dde46b 100644 --- a/src/ipcpd/normal/dt_pci.c +++ b/src/ipcpd/normal/dt_pci.c @@ -47,7 +47,7 @@ struct { /* offsets */ size_t qc_o; size_t ttl_o; - size_t pdu_type_o; + size_t type_o; } dt_pci_info; int dt_pci_init(void) @@ -66,12 +66,12 @@ int dt_pci_init(void) dt_pci_info.qc_o = dt_pci_info.dtc.addr_size; dt_pci_info.ttl_o = dt_pci_info.qc_o + QC_SIZE; - - dt_pci_info.head_size = dt_pci_info.ttl_o + PDU_TYPE_SIZE; - if (dt_pci_info.dtc.has_ttl) - dt_pci_info.head_size += TTL_SIZE; + dt_pci_info.type_o = dt_pci_info.ttl_o + TTL_SIZE; + else + dt_pci_info.type_o = dt_pci_info.ttl_o; + dt_pci_info.head_size = dt_pci_info.type_o + PDU_TYPE_SIZE; dt_pci_info.tail_size = dt_pci_info.dtc.has_chk ? CHK_SIZE : 0; return 0; @@ -100,7 +100,7 @@ int dt_pci_ser(struct shm_du_buff * sdb, memcpy(head + dt_pci_info.qc_o, &dt_pci->qc, QC_SIZE); if (dt_pci_info.dtc.has_ttl) memcpy(head + dt_pci_info.ttl_o, &ttl, TTL_SIZE); - memcpy(head + dt_pci_info.pdu_type_o, &dt_pci->pdu_type, PDU_TYPE_SIZE); + memcpy(head + dt_pci_info.type_o, &dt_pci->pdu_type, PDU_TYPE_SIZE); if (dt_pci_info.dtc.has_chk) { tail = shm_du_buff_tail_alloc(sdb, dt_pci_info.tail_size); @@ -137,7 +137,7 @@ void dt_pci_des(struct shm_du_buff * sdb, dt_pci->ttl = 1; } - memcpy(&dt_pci->pdu_type, head + dt_pci_info.pdu_type_o, PDU_TYPE_SIZE); + memcpy(&dt_pci->pdu_type, head + dt_pci_info.type_o, PDU_TYPE_SIZE); } void dt_pci_shrink(struct shm_du_buff * sdb) |