STRUCT OVPN_PEER_COLLECTION(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 struct ovpn_peer_collection(9) β€” Kernel API Manual 🌸

ok so this is the manual page for struct ovpn_peer_collection(9), and bestie, it's literally the container of peers for MultiPeer mode πŸ‘‘ think of it as the group chat where every peer gets sorted into the right little table. we're living in the kernel here, iykyk πŸ’…


✨ NAME ✨

struct ovpn_peer_collection β€” container of peers for MultiPeer mode 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

no cap, here's the whole struct, copied exactly, don't touch a single space:

struct ovpn_peer_collection {
    unsigned long by_id[1 << (( 12) - 1)];
    struct hlist_nulls_head by_vpn_addr4[1 << 12];
    struct hlist_nulls_head by_vpn_addr6[1 << 12];
    struct hlist_nulls_head by_transp_addr[1 << 12];
 };

like… look at those arrays. absolutely iconic sizing. 1 << 12 this, 1 << (( 12) - 1) that β€” and yes, that double-paren with the space inside is exactly how it's written, we do not edit the struct, periodt πŸ™ˆ


πŸŽ€ Members πŸŽ€

  • by_id β€” the table of peers, indexed by ID πŸ’– this is the main-character lookup right here.
  • by_vpn_addr4 β€” table of peers indexed by VPN IPv4 address. heads up: items can be rehashed on the fly due to a peer IP change, so don't get too attached to where a thing lives πŸ‘€
  • by_vpn_addr6 β€” table of peers indexed by VPN IPv6 address. same deal, items can be rehashed on the fly due to a peer IP change πŸ¦‹
  • by_transp_addr β€” table of peers indexed by transport address. and yeah, same warning: items can be rehashed on the fly due to a peer IP change πŸ’€ the way these tables stay flexible is honestly so real.

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/net/ovpn/ovpnpriv.h
  • struct ovpn_priv(9)

like, go read those next, bestie, they're literally right there 🧚


πŸ’œ reminder that those three address tables all say "items can be rehashed on the fly due to peer IP change" and that is not a drill β€” the peer IP changes, the hashing shifts. don't be out here assuming a fixed bucket, fr fr.

ok that's the whole page!! tysm for reading πŸŽ€ this came from ./drivers/net/ovpn, October 2026, and it was iconic of you to make it to the end. slay β­πŸ‘‘πŸ’…

πŸ“¦ where this page comes from