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)
Wed, Jan 29, 11:49 AM
Unknown Object (File)
Nov 18 2024, 1:32 AM
Unknown Object (File)
Nov 18 2024, 1:31 AM
Unknown Object (File)
Nov 18 2024, 1:29 AM
Unknown Object (File)
Nov 18 2024, 12:05 AM
Unknown Object (File)
Nov 17 2024, 11:47 PM
Unknown Object (File)
Nov 10 2024, 2:51 AM
Unknown Object (File)
Nov 2 2024, 4:06 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 49664
Build 46554: 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

4329

Is this cast still needed?

4336

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