summaryrefslogtreecommitdiff
path: root/src/lib/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/dev.c')
-rw-r--r--src/lib/dev.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index 166aba5c..3fb8d831 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -98,14 +98,14 @@ struct flow {
ssize_t part_idx;
struct crypt_ctx * crypt;
- int headsz; /* Selector */
- int tailsz; /* Tag + CRC */
+ int headsz; /* Selector */
+ int tailsz; /* Tag + CRC */
- struct timespec rk_grace; /* TX-promote deadline (0 = none) */
- struct timespec rk_attempt; /* Last re-key attempt (backoff) */
- bool rk_wm_inflight; /* Re-key trigger in flight */
- uint32_t rk_wm_ctr; /* Throttles the consult */
- bool rk_initiator; /* OAP initiator this re-key */
+ struct timespec rk_grace; /* TX-promote deadline */
+ struct timespec rk_attempt; /* Last re-key attempt */
+ bool rk_wm_inflight; /* Re-key trigger in flight */
+ uint32_t rk_wm_ctr; /* Throttles the consult */
+ bool rk_initiator; /* OAP initiator this re-key */
struct timespec snd_act;
struct timespec rcv_act;
@@ -1739,8 +1739,7 @@ static ssize_t flow_write_frag(struct flow * flow,
memcpy(ptr, src + off, clen);
- ret = flow_tx_spb(flow, spb, flow_frag_role(i, n),
- block, dl);
+ ret = flow_tx_spb(flow, spb, flow_frag_role(i, n), block, dl);
if (ret < 0) {
ssm_pool_remove(proc.pool, idx);
if (off > 0)
@@ -2887,19 +2886,13 @@ int ipcp_flow_get_qoscube(int fd,
return 0;
}
+/* Not a snapshot: two atomic loads; caller keeps the fd live. */
size_t ipcp_flow_queued(int fd)
{
- size_t q;
-
- pthread_rwlock_rdlock(&proc.lock);
-
+ assert(fd >= 0 && fd < PROC_MAX_FLOWS);
assert(proc.flows[fd].info.id >= 0);
- q = ssm_rbuff_queued(proc.flows[fd].tx_rb);
-
- pthread_rwlock_unlock(&proc.lock);
-
- return q;
+ return ssm_rbuff_queued(proc.flows[fd].tx_rb);
}
int local_flow_transfer(int src_fd,