Page MenuHomeFreeBSD

if_ovpn: allow peer lookup by vpn4/vpn6 address
ClosedPublic

Authored by kp on Dec 5 2022, 4:31 PM.
Tags
None
Referenced Files
F102652613: D37605.diff
Fri, Nov 15, 9:20 AM
Unknown Object (File)
Thu, Nov 14, 2:28 AM
Unknown Object (File)
Oct 1 2024, 2:42 PM
Unknown Object (File)
Sep 24 2024, 5:34 PM
Unknown Object (File)
Sep 20 2024, 3:10 PM
Unknown Object (File)
Sep 18 2024, 9:38 PM
Unknown Object (File)
Sep 5 2024, 2:29 AM
Unknown Object (File)
Sep 4 2024, 2:12 PM

Details

Summary

Introduce two more RB_TREEs so that we can look up peers by their peer
id (already present) or vpn4 or vpn6 address.
This removes the last linear scan of the peer list.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

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

Event Timeline

zlei added inline comments.
sys/net/if_ovpn.c
299

memcmp might be overweight here.

306

I'd like to use clang / gcc extension __uint128_t to simplify and make the compare performant, but it seems kernel is not ready for it yet ( not available from sys/_stdint.h ).

Maybe just leave as is or convert to two compare of uint64_t .

1688

Compiler is smart :)

1702

Ditto.

Assign IP address directly, rather than memcpy()

This revision was not accepted when it landed; it landed in state Needs Review.Dec 14 2022, 5:50 AM
This revision was automatically updated to reflect the committed changes.