summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/dt.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-04-26 11:57:56 +0200
committerdimitri staessens <dimitri.staessens@ugent.be>2017-04-26 12:01:52 +0200
commite2c8623e66d66f4b9c8619349d11375a32ac2134 (patch)
tree4e4d3b4f8da805ca9f0f0733977ff678c064660f /src/ipcpd/normal/dt.c
parentea16fc664673d65c0e3e51591258be4d3b8be406 (diff)
downloadouroboros-e2c8623e66d66f4b9c8619349d11375a32ac2134.tar.gz
ouroboros-e2c8623e66d66f4b9c8619349d11375a32ac2134.zip
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.
Diffstat (limited to 'src/ipcpd/normal/dt.c')
-rw-r--r--src/ipcpd/normal/dt.c12
1 files changed, 6 insertions, 6 deletions
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;
}