- Update the flow sequence before converting count to

network byte order.
- Update the flow sequence in one atomic op instead of two.

Reported by:	Denis Shaposhnikov <dsh vlink.ru>
Reported by:	Daniil Kharoun <kdl chelcom.ru>
PR:		kern/89417
This commit is contained in:
Gleb Smirnoff 2005-11-27 02:43:08 +00:00
parent 6829585c43
commit 14379bfbba

View File

@ -621,12 +621,9 @@ export_send(priv_p priv, item_p item)
getnanotime(&ts);
header->unix_secs = htonl(ts.tv_sec);
header->unix_nsecs = htonl(ts.tv_nsec);
header->flow_seq = htonl(atomic_fetchadd_32(&priv->flow_seq,
header->count));
header->count = htons(header->count);
header->flow_seq = htonl(atomic_load_acq_32(&priv->flow_seq));
/* Flow sequence contains number of first record, so it
is updated after being put in header. */
atomic_add_32(&priv->flow_seq, header->count);
if (priv->export != NULL)
/* Should also NET_LOCK_GIANT(). */