Page MenuHomeFreeBSD

IfAPI: Add capabilities2/capenable2 accessors
ClosedPublic

Authored by jhibbits on Feb 10 2023, 3:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 2:51 AM
Unknown Object (File)
Sat, Nov 2, 4:06 AM
Unknown Object (File)
Thu, Oct 31, 1:25 PM
Unknown Object (File)
Oct 11 2024, 4:26 AM
Unknown Object (File)
Sep 26 2024, 1:46 PM
Unknown Object (File)
Sep 24 2024, 12:33 AM
Unknown Object (File)
Sep 22 2024, 5:52 PM
Unknown Object (File)
Sep 19 2024, 5:49 AM
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