Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr>
Sponsored by: Defenso
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Fix braces, indentation, restore original lock and set VNET
The VNET fix in ngdwrite was necessary to avoid a panic in
ng_ID2noderef (ng_base.c) when the ng_device is connected to
an ng_bridge node.
Clean up device destruction
- Fix order of knlist_destroy() and mtx_destroy()
- Call knlist_clear() before knlist_destroy()
- Add NGDF_DYING flag to send off the reader properly
- Reverted unnecessary mtx changes in ngdread()
| sys/netgraph/ng_device.c | ||
|---|---|---|
| 534 | We do not hold the ngd_mtx here, so this check is racy. Presumably we should check immediately before going to sleep below? | |
| 589 | ||
| 635 | This is kind of misleading, as it reports only the number of bytes for the first packet in the queue, but we may have many packets available to read. The queue doesn't store the total number of bytes though, and probably we don't really want to traverse the whole queue to calculate the true number. I suggest adding a comment here explaining that. | |
Could you please mail me git format-patch-generated patches to apply to the tree? Or submit them as a pull request on github. Then I'll push them to main.