diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-10-05 13:41:31 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-10-05 13:41:31 +0200 |
commit | f266224ff38930cff1c1765313f0da7b93539553 (patch) | |
tree | ec86e2dbcaa4bfc7977978611d554425232248ce /src/ipcpd | |
parent | 985d370f259c80c7f8b5c60070192745e7c70687 (diff) | |
parent | caefb38ad02a4bd08ac7e80ca5bac01f38a493df (diff) | |
download | ouroboros-f266224ff38930cff1c1765313f0da7b93539553.tar.gz ouroboros-f266224ff38930cff1c1765313f0da7b93539553.zip |
Merged in sandervrijders/ouroboros/be-bugfix (pull request #254)
ipcpd: shim-eth-llc: Use correct SAP to lookup in the table
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/shim-eth-llc/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c index 7a64b9e1..03e8beb1 100644 --- a/src/ipcpd/shim-eth-llc/main.c +++ b/src/ipcpd/shim-eth-llc/main.c @@ -927,16 +927,18 @@ static int eth_llc_ipcp_flow_alloc_resp(int fd, int response) static int eth_llc_ipcp_flow_dealloc(int fd) { uint8_t sap; + uint8_t r_sap; uint8_t addr[MAC_SIZE]; int ret; pthread_rwlock_rdlock(&ipcpi.state_lock); pthread_rwlock_wrlock(ð_llc_data.flows_lock); - sap = eth_llc_data.fd_to_ef[fd].r_sap; + r_sap = eth_llc_data.fd_to_ef[fd].r_sap; + sap = eth_llc_data.fd_to_ef[fd].sap; memcpy(addr, eth_llc_data.fd_to_ef[fd].r_addr, MAC_SIZE); - bmp_release(eth_llc_data.saps, eth_llc_data.fd_to_ef[fd].sap); + bmp_release(eth_llc_data.saps, sap); eth_llc_data.fd_to_ef[fd].sap = -1; eth_llc_data.fd_to_ef[fd].r_sap = -1; memset(ð_llc_data.fd_to_ef[fd].r_addr, 0, MAC_SIZE); @@ -945,7 +947,7 @@ static int eth_llc_ipcp_flow_dealloc(int fd) pthread_rwlock_unlock(ð_llc_data.flows_lock); - ret = eth_llc_ipcp_sap_dealloc(addr, sap); + ret = eth_llc_ipcp_sap_dealloc(addr, r_sap); pthread_rwlock_unlock(&ipcpi.state_lock); if (ret < 0) |