summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-10-23 12:38:31 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-10-23 12:38:31 +0200
commitcd9a137216afe11620262e1df763b1c757cebd16 (patch)
tree98954598a7b7a3eb2d3e42d43f0b7c2801d91d9a
parent84b11f3322797759fef746786badcd10936dfda4 (diff)
downloadouroboros-cd9a137216afe11620262e1df763b1c757cebd16.tar.gz
ouroboros-cd9a137216afe11620262e1df763b1c757cebd16.zip
dev, ipcp: Fix setting default flow options
The default flow options were not set when a flow allocation request arrives remotely. This went unnoticed due to a previous bug.
-rw-r--r--src/ipcpd/shim-eth-llc/main.c11
-rw-r--r--src/lib/dev.c1
2 files changed, 3 insertions, 9 deletions
diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c
index 7976a2d1..3fc7eda5 100644
--- a/src/ipcpd/shim-eth-llc/main.c
+++ b/src/ipcpd/shim-eth-llc/main.c
@@ -587,7 +587,6 @@ static void * eth_llc_ipcp_sdu_reader(void * o)
pthread_rwlock_unlock(&eth_llc_data.flows_lock);
flow_write(fd, &llc_frame->payload, length);
-
}
#if defined(PACKET_RX_RING) && defined(PACKET_TX_RING)
offset = (offset + 1) & ((SHM_BUFFER_SIZE) - 1);
@@ -617,10 +616,7 @@ static void * eth_llc_ipcp_sdu_writer(void * o)
if (ret == -ETIMEDOUT)
continue;
- if (ret < 0) {
- LOG_ERR("Event wait returned error code %d.", -ret);
- continue;
- }
+ assert(!ret);
while ((fd = fqueue_next(fq)) >= 0) {
if (ipcp_flow_read(fd, &sdb)) {
@@ -968,10 +964,7 @@ static int eth_llc_ipcp_flow_alloc_resp(int fd, int response)
pthread_rwlock_unlock(&eth_llc_data.flows_lock);
pthread_rwlock_unlock(&ipcpi.state_lock);
- if (eth_llc_ipcp_sap_alloc_resp(r_addr,
- ssap,
- r_sap,
- response) < 0) {
+ if (eth_llc_ipcp_sap_alloc_resp(r_addr, ssap, r_sap, response) < 0) {
pthread_rwlock_rdlock(&ipcpi.state_lock);
pthread_rwlock_wrlock(&eth_llc_data.flows_lock);
bmp_release(eth_llc_data.saps, eth_llc_data.fd_to_ef[fd].sap);
diff --git a/src/lib/dev.c b/src/lib/dev.c
index cac3ca37..0a22cb12 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -1151,6 +1151,7 @@ int ipcp_flow_req_arr(pid_t api, char * dst_name, char * src_ae_name)
}
ai.flows[fd].port_id = port_id;
+ ai.flows[fd].oflags = FLOW_O_DEFAULT;
ai.ports[port_id].fd = fd;
port_set_state(&(ai.ports[port_id]), PORT_ID_ASSIGNED);