netgraph/ng_one2main: Clarification in comments about copy mode

The original comment suggests an optimization, which was proven wrong.

Reported by:	nc
Reviewed by:	kp, nc
Approved by:	kp (mentor)
Differential Revision:	https://reviews.freebsd.org/D23727
This commit is contained in:
Lutz Donnerhacke 2021-01-18 14:10:34 +01:00
parent 7c7c231c14
commit c3e75b6c1a

View File

@ -451,15 +451,15 @@ ng_one2many_rcvdata(hook_p hook, item_p item)
/* no need to copy data for the 1st one */
dst = &priv->many[priv->activeMany[0]];
/* make copies of data and send for all links
* except the first one, which we'll do last
/* make modifiable copies of data and send for all
* links except the first one, which we'll do last
*/
for (i = 1; i < priv->numActiveMany; i++) {
struct mbuf *m2;
struct ng_one2many_link *mdst;
mdst = &priv->many[priv->activeMany[i]];
m2 = m_dup(m, M_NOWAIT); /* XXX m_copypacket() */
m2 = m_dup(m, M_NOWAIT);
if (m2 == NULL) {
mdst->stats.memoryFailures++;
NG_FREE_ITEM(item);