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
F131581558: D12551.diff
Thu, Oct 9, 11:39 AM
Unknown Object (File)
Mon, Oct 6, 12:55 AM
Unknown Object (File)
Fri, Oct 3, 6:11 PM
Unknown Object (File)
Fri, Oct 3, 4:29 AM
Unknown Object (File)
Wed, Oct 1, 9:38 AM
Unknown Object (File)
Tue, Sep 30, 9:54 AM
Unknown Object (File)
Fri, Sep 12, 3:56 PM
Unknown Object (File)
Thu, Sep 11, 7:30 PM
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 Skipped
Unit
Tests Skipped

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.