Page MenuHomeFreeBSD

netgraph: ng_device: set curvnet when writing from the cdev
AcceptedPublic

Authored by kevans on Wed, Sep 24, 1:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 10, 9:19 AM
Unknown Object (File)
Fri, Oct 10, 6:47 AM
Unknown Object (File)
Fri, Oct 10, 2:59 AM
Unknown Object (File)
Fri, Oct 10, 2:59 AM
Unknown Object (File)
Thu, Oct 9, 10:06 PM
Unknown Object (File)
Wed, Oct 8, 10:43 AM
Unknown Object (File)
Thu, Oct 2, 4:40 PM
Unknown Object (File)
Thu, Sep 25, 5:58 AM

Details

Summary

As noted in the comment, ng_snd_item() doesn't *always* need a vnet
context set -- in particular, it'll often enqueue the item instead of
sending it immediately, and the thread that later dequeues the item will
do the right thing. However, in the case of a node like ng_bridge, we
might be sending immediately and require curvnet to be set as it
transitions through the stack.

The cdev could be made visible for use by another vnet that is not the
ng_device's home, so be sure to use that one rather than the prison
vnet.

Reported by: Quentin Thébault <quentin.thebault@defenso.fr>
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 67270
Build 64153: arc lint + arc unit