From e2c8623e66d66f4b9c8619349d11375a32ac2134 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Wed, 26 Apr 2017 11:57:56 +0200 Subject: lib: Add call to reserve blocks in rdrbuff This adds a call ipcp_sdb_reserve to reserve memory in the rdrbuff without directly writing to a flow. The ipcp_flow_del function was renamed to ipcp_sdb_release. The functions operating on sdbs are moved to their own header. --- src/ipcpd/normal/dt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ipcpd/normal/dt.c') diff --git a/src/ipcpd/normal/dt.c b/src/ipcpd/normal/dt.c index 593064f4..6ac73a93 100644 --- a/src/ipcpd/normal/dt.c +++ b/src/ipcpd/normal/dt.c @@ -93,7 +93,7 @@ static int sdu_handler(int fd, if (pci.dst_addr != ipcpi.dt_addr) { if (pci.ttl == 0) { log_dbg("TTL was zero."); - ipcp_flow_del(sdb); + ipcp_sdb_release(sdb); return 0; } @@ -103,7 +103,7 @@ static int sdu_handler(int fd, if (fd < 0) { pff_unlock(dt.pff[qc]); log_err("No next hop for %" PRIu64, pci.dst_addr); - ipcp_flow_del(sdb); + ipcp_sdb_release(sdb); return -1; } @@ -111,7 +111,7 @@ static int sdu_handler(int fd, if (ipcp_flow_write(fd, sdb)) { log_err("Failed to write SDU to fd %d.", fd); - ipcp_flow_del(sdb); + ipcp_sdb_release(sdb); return -1; } } else { @@ -268,7 +268,7 @@ int dt_write_sdu(struct pci * pci, pff_unlock(dt.pff[pci->qos_id]); log_err("Could not get nhop for address %" PRIu64, pci->dst_addr); - ipcp_flow_del(sdb); + ipcp_sdb_release(sdb); return -1; } @@ -276,13 +276,13 @@ int dt_write_sdu(struct pci * pci, if (shm_pci_ser(sdb, pci)) { log_err("Failed to serialize PDU."); - ipcp_flow_del(sdb); + ipcp_sdb_release(sdb); return -1; } if (ipcp_flow_write(fd, sdb)) { log_err("Failed to write SDU to fd %d.", fd); - ipcp_flow_del(sdb); + ipcp_sdb_release(sdb); return -1; } -- cgit v1.2.3