summaryrefslogtreecommitdiff
path: root/src/ipcpd/shim-eth-llc/main.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2017-08-03 11:09:58 -0600
committerDimitri Staessens <dimitri.staessens@ugent.be>2017-08-03 11:09:58 -0600
commit6eb3105f908158130bbc415e7376e3c2d7aafb5e (patch)
treec758cb4008d7d81173fca556ae8a2fd210b295ec /src/ipcpd/shim-eth-llc/main.c
parentb92eac2e9f6d686a9e2f748f8097aedbb373395c (diff)
parente3d19da0501bbb80ba1caf562ba61a99c63b10b7 (diff)
downloadouroboros-6eb3105f908158130bbc415e7376e3c2d7aafb5e.tar.gz
ouroboros-6eb3105f908158130bbc415e7376e3c2d7aafb5e.zip
Merge remote-tracking branch 'origin/testing-deadlines' into be
Diffstat (limited to 'src/ipcpd/shim-eth-llc/main.c')
-rw-r--r--src/ipcpd/shim-eth-llc/main.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c
index 28ab897b..4899cd83 100644
--- a/src/ipcpd/shim-eth-llc/main.c
+++ b/src/ipcpd/shim-eth-llc/main.c
@@ -382,14 +382,19 @@ static int eth_llc_ipcp_sap_req(uint8_t r_sap,
qoscube_t cube)
{
struct timespec ts = {0, EVENT_WAIT_TIMEOUT * 1000};
+ struct timespec abstime;
int fd;
+ clock_gettime(PTHREAD_COND_CLOCK, &abstime);
+
pthread_mutex_lock(&ipcpi.alloc_lock);
- while (ipcpi.alloc_id != -1 && ipcp_get_state() == IPCP_OPERATIONAL)
+ while (ipcpi.alloc_id != -1 && ipcp_get_state() == IPCP_OPERATIONAL) {
+ ts_add(&abstime, &ts, &abstime);
pthread_cond_timedwait(&ipcpi.alloc_cond,
&ipcpi.alloc_lock,
- &ts);
+ &abstime);
+ }
if (ipcp_get_state() != IPCP_OPERATIONAL) {
log_dbg("Won't allocate over non-operational IPCP.");
@@ -1023,16 +1028,21 @@ static int eth_llc_ipcp_flow_alloc_resp(int fd,
int response)
{
struct timespec ts = {0, EVENT_WAIT_TIMEOUT * 1000};
+ struct timespec abstime;
uint8_t ssap = 0;
uint8_t r_sap = 0;
uint8_t r_addr[MAC_SIZE];
+ clock_gettime(PTHREAD_COND_CLOCK, &abstime);
+
pthread_mutex_lock(&ipcpi.alloc_lock);
- while (ipcpi.alloc_id != fd && ipcp_get_state() == IPCP_OPERATIONAL)
+ while (ipcpi.alloc_id != fd && ipcp_get_state() == IPCP_OPERATIONAL){
+ ts_add(&abstime, &ts, &abstime);
pthread_cond_timedwait(&ipcpi.alloc_cond,
&ipcpi.alloc_lock,
- &ts);
+ &abstime);
+ }
if (ipcp_get_state() != IPCP_OPERATIONAL) {
pthread_mutex_unlock(&ipcpi.alloc_lock);