Page MenuHomeFreeBSD

IfAPI: Add capabilities2/capenable2 accessors
ClosedPublic

Authored by jhibbits on Feb 10 2023, 3:48 PM.
Tags
None
Referenced Files
F99597280: D38487.diff
Fri, Oct 11, 4:26 AM
Unknown Object (File)
Thu, Sep 26, 1:46 PM
Unknown Object (File)
Tue, Sep 24, 12:33 AM
Unknown Object (File)
Sun, Sep 22, 5:52 PM
Unknown Object (File)
Thu, Sep 19, 5:49 AM
Unknown Object (File)
Sat, Sep 14, 11:51 PM
Unknown Object (File)
Sep 10 2024, 12:57 AM
Unknown Object (File)
Sep 3 2024, 7:19 PM
Subscribers

Details

Summary

As a stopgap measure add basic accessors for the if_capabilities2 and
if_capenable2 members to further hide the ifnet details.

Sponsored by: Juniper Networks, Inc.

Diff Detail

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

Event Timeline

sys/net/if.c
4277

This seems to be a systematic style(9) bugs.

Also, both 0 and 0xffffffff keep caps intact. Why?

Also, I believe it is reasonable to have a symbolic name like IF_MASK_NONE for the value that keeps the mask(s) intact.

sys/net/if.c
4277

The arguments are simply bitmasks, so 'setting' 0 and 'clearing' 0 are nops. I'll remove the conditions, since they really are pointless and this was purely a copy of the if_capabilities accessors. I can add IF_MASK_NONE as 0, but documentation is better in this regard (documentation currently in the works, and will be completed after the IfAPI is fully completed).

Address feedback. Clean up the pointless casts.

sys/net/if.c
4264

Is this cast to remove const? I think you should use __DECONST then

4327

Is this cast still needed?

4334

Why the cast?

sys/net/if.c
4264

Nope, it shouldn't be here. Thought I had cleaned them all up, but looks like I did it in the overall cleanup commit, rather than this one.

Works for me as a stopgap.

This revision is now accepted and ready to land.Feb 13 2023, 9:30 PM