diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2017-04-05 14:45:41 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2017-04-05 16:03:07 +0200 |
commit | 7ba8e234b6c45774b54d24e632cb14730a62b0b3 (patch) | |
tree | 8bcbb8e43cab5855d57c03ece5bcd9192a2a6aa4 | |
parent | 901a97a2a51ece0fd9991797b9764f60268962b3 (diff) | |
download | ouroboros-7ba8e234b6c45774b54d24e632cb14730a62b0b3.tar.gz ouroboros-7ba8e234b6c45774b54d24e632cb14730a62b0b3.zip |
ipcpd: normal: Add missing else clause
A missing else clause was missing in the fast path, causing the PCI to
be shrunk when it should not be. A double free has also been fixed.
-rw-r--r-- | src/ipcpd/normal/fmgr.c | 15 | ||||
-rw-r--r-- | src/ipcpd/normal/pol/complete.c | 2 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c index 56f1e099..3191eac5 100644 --- a/src/ipcpd/normal/fmgr.c +++ b/src/ipcpd/normal/fmgr.c @@ -186,8 +186,6 @@ void * fmgr_nm1_sdu_reader(void * o) shm_pci_des(sdb, &pci); if (pci.dst_addr != ipcpi.dt_addr) { - log_dbg("PDU needs to be forwarded."); - if (pci.ttl == 0) { log_dbg("TTL was zero."); ipcp_flow_del(sdb); @@ -211,14 +209,13 @@ void * fmgr_nm1_sdu_reader(void * o) ipcp_flow_del(sdb); continue; } - } + } else { + shm_pci_shrink(sdb); - shm_pci_shrink(sdb); - - if (frct_nm1_post_sdu(&pci, sdb)) { - log_err("Failed to hand PDU to FRCT."); - ipcp_flow_del(sdb); - continue; + if (frct_nm1_post_sdu(&pci, sdb)) { + log_err("Failed to hand PDU to FRCT."); + continue; + } } } } diff --git a/src/ipcpd/normal/pol/complete.c b/src/ipcpd/normal/pol/complete.c index 1f3f6031..6c0be9ec 100644 --- a/src/ipcpd/normal/pol/complete.c +++ b/src/ipcpd/normal/pol/complete.c @@ -89,7 +89,7 @@ static void * allocator(void * o) /* FIXME: subscribe to members to keep the graph complete. */ len = rib_children("/" MEMBERS_NAME, &children); for (i = 0; i < len; ++i) { - if (strcmp(children[i], ipcpi.name) < 0) { + if (strcmp(children[i], ipcpi.name) != 0) { if (connmgr_alloc(complete->ae, children[i], &qs, |