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
F102660138: D37605.id113838.diff
Fri, Nov 15, 11:58 AM
F102659282: D37605.id114127.diff
Fri, Nov 15, 11:42 AM
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

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 Not Applicable
Unit
Tests Not Applicable

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.