Page MenuHomeFreeBSD

ifnet(9): split ifc_alloc_unit() (should make code a bit cleaner).
ClosedPublic

Authored by avos on Sep 30 2017, 9:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 12:39 AM
Unknown Object (File)
Oct 19 2024, 5:07 AM
Unknown Object (File)
Oct 3 2024, 2:40 PM
Unknown Object (File)
Oct 3 2024, 9:38 AM
Unknown Object (File)
Oct 2 2024, 11:30 PM
Unknown Object (File)
Sep 23 2024, 2:25 PM
Unknown Object (File)
Sep 22 2024, 1:25 AM
Unknown Object (File)
Sep 8 2024, 4:18 AM
Subscribers

Details

Summary

Allocate smallest unit number from pool from ifc_alloc_unit_next() and exact unit number (if available) from ifc_alloc_unit_specific().

While here, fix potential endless loop (*unit < 0 -> alloc_unr() succeeds but ifunit() fails -> (*unit)++ and then alloc_unr_specific() fails ->(*unit) is overridden with return result (-1) and then used instead of previous unit number).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Yes (but without reassigning *unit - it will not change after alloc_unr_specific() anyway).

Can you please grab the PR? :)

This revision was automatically updated to reflect the committed changes.