diff options
Diffstat (limited to 'sys/netgraph/ng_pipe.c')
-rw-r--r-- | sys/netgraph/ng_pipe.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/netgraph/ng_pipe.c b/sys/netgraph/ng_pipe.c index a094646..a454624 100644 --- a/sys/netgraph/ng_pipe.c +++ b/sys/netgraph/ng_pipe.c @@ -816,14 +816,17 @@ pipe_dequeue(struct hookinfo *hinfo, struct timeval *now) { } /* Randomly discard the frame, according to BER setting */ - if (hinfo->cfg.ber && - ((oldrand = rand) ^ (rand = random())<<17) >= - hinfo->ber_p[priv->overhead + m->m_pkthdr.len] ) { - hinfo->stats.out_disc_frames++; - hinfo->stats.out_disc_octets += m->m_pkthdr.len; - uma_zfree(ngp_zone, ngp_h); - m_freem(m); - continue; + if (hinfo->cfg.ber) { + oldrand = rand; + rand = random(); + if (((oldrand ^ rand) << 17) >= + hinfo->ber_p[priv->overhead + m->m_pkthdr.len]) { + hinfo->stats.out_disc_frames++; + hinfo->stats.out_disc_octets += m->m_pkthdr.len; + uma_zfree(ngp_zone, ngp_h); + m_freem(m); + continue; + } } /* Discard frame if outbound queue size limit exceeded */ |