mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-30 16:51:41 +00:00
- Don't lose TCP flags of the first packet in a flow.
- Don't account length of the first packet in a flow twice.
This commit is contained in:
parent
1ca479296c
commit
c1249c6338
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=143890
@ -220,7 +220,8 @@ bit_count(uint32_t v)
|
||||
* and insert flow entry.
|
||||
*/
|
||||
static __inline int
|
||||
hash_insert(priv_p priv, int slot, struct flow_rec *r, int plen)
|
||||
hash_insert(priv_p priv, int slot, struct flow_rec *r, int plen,
|
||||
uint8_t tcp_flags)
|
||||
{
|
||||
struct flow_hash_entry *h = priv->hash;
|
||||
struct flow_entry *fle;
|
||||
@ -239,8 +240,7 @@ hash_insert(priv_p priv, int slot, struct flow_rec *r, int plen)
|
||||
bcopy(r, &fle->f.r, sizeof(struct flow_rec));
|
||||
fle->f.bytes = plen;
|
||||
fle->f.packets = 1;
|
||||
|
||||
priv->info.nfinfo_bytes += plen;
|
||||
fle->f.tcp_flags = tcp_flags;
|
||||
|
||||
fle->f.first = fle->f.last = time_uptime;
|
||||
|
||||
@ -521,7 +521,7 @@ ng_netflow_flow_add(priv_p priv, struct mbuf **m, iface_p iface)
|
||||
} else { /* a new flow entry */
|
||||
|
||||
mtx_unlock(&priv->work_mtx);
|
||||
return hash_insert(priv, slot, &r, plen);
|
||||
return hash_insert(priv, slot, &r, plen, tcp_flags);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user