Page MenuHomeFreeBSD

netgraph/ng_bridge: Handle send errors during loop processing
ClosedPublic

Authored by donner on Apr 27 2021, 7:58 AM.
Tags
None
Referenced Files
F103221351: D30008.diff
Fri, Nov 22, 9:09 AM
Unknown Object (File)
Oct 17 2024, 11:23 AM
Unknown Object (File)
Oct 1 2024, 1:31 PM
Unknown Object (File)
Sep 30 2024, 1:04 PM
Unknown Object (File)
Sep 18 2024, 7:33 AM
Unknown Object (File)
Sep 18 2024, 12:10 AM
Unknown Object (File)
Sep 16 2024, 8:55 PM
Unknown Object (File)
Sep 16 2024, 12:49 PM

Details

Summary

If sending out a packet fails during the loop over all links, the
allocated memory is leaked and not all links receive a copy. This
patch fixes those problems, clarifies a premature abort of the loop,
and fixes a minory style(9) bug.

PR: 255430
MFC: 1 week
Submitted by: Dancho Penev

Test Plan

Build a bridge over a bunch of ng_eiface(4). Set one of the
interfaces down (causing the error), try to send out a broadcast
packet and monitor all the interfaces.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38888
Build 35777: arc lint + arc unit

Event Timeline

  • Free packet if not send at all.
donner retitled this revision from netgraph/ng_bridge: Handle send errors during loop handling to netgraph/ng_bridge: Handle send errors during loop processing.Apr 27 2021, 11:11 AM
donner edited the summary of this revision. (Show Details)
julian added inline comments.
sys/netgraph/ng_bridge.c
655

I would do: if error ( error stuff; return error} followed by the non error case continuing on with one level less indent. just a style thing.. result is the same

  • Restructure the error handling in a more common way.
This revision was not accepted when it landed; it landed in state Needs Review.May 13 2021, 7:51 PM
This revision was automatically updated to reflect the committed changes.