int num;
int update_last_write = 0;
unsigned int count = 0;
- unsigned int oc = 0;
+ uint32_t oc;
+ uint32_t uo;
uint16_t status = 0;
uint32_t wpkt_quanta_old;
+ // save current # updates sent
+ oc = atomic_load_explicit(&peer->update_out, memory_order_relaxed);
+
// cache current write quanta
wpkt_quanta_old =
atomic_load_explicit(&peer->bgp->wpkt_quanta, memory_order_relaxed);
done : {
/* Update last_update if UPDATEs were written. */
- if (peer->update_out > oc)
+ uo = atomic_load_explicit(&peer->update_out, memory_order_relaxed);
+ if (uo > oc)
atomic_store_explicit(&peer->last_update, bgp_clock(),
memory_order_relaxed);
- /* If we TXed any flavor of packet update last_write */
+ /* If we TXed any flavor of packet */
if (update_last_write)
atomic_store_explicit(&peer->last_write, bgp_clock(),
memory_order_relaxed);