STRUCT OVPN_SOCKET(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ovpn_socket(9) β€” a kernel socket referenced in the ovpn code

okay bestie so this is a page from the Kernel API Manual, and honestly? it's giving "small struct, big responsibilities" energy. Sit down, grab a strawberry πŸ“, and let me walk you through it.


✨ NAME ✨

struct ovpn_socket β€” a kernel socket referenced in the ovpn code 🫢

like literally that's it, that's the whole name section, we love a concise icon.


🌸 SYNOPSIS 🌸

here's the whole struct, verbatim, no cap β€” don't let me catch you retyping it by hand:

struct ovpn_socket {
    union {
      struct {
        struct ovpn_priv *ovpn;
        netdevice_tracker dev_tracker;
      };
      struct ovpn_peer *peer;
    };
    struct sock *sk;
    struct kref refcount;
    struct work_struct work;
    struct work_struct tcp_tx_work;
 };

πŸŽ€ Members πŸŽ€

okay so inside this struct there's a fake-deep nesting situation, and every field matters, so let's go one by one:

  • {unnamed_union} β€” anonymous πŸ‘» (yes, it really is unnamed, that's the whole vibe)
  • {unnamed_struct} β€” also anonymous πŸ‘» (matching set, iconic)
  • ovpn β€” the ovpn instance that owns this socket. UDP only, bestie, don't come at it with TCP πŸ™ˆ
  • dev_tracker β€” reference tracker for the associated dev. also UDP only ✨
  • peer β€” the unique peer transmitting over this socket. TCP only this time β€” the union said "pick a lane" πŸ’…
  • sk β€” the low level sock object, the actual little guy underneath it all
  • refcount β€” how many contexts are currently referencing this object. that's its whole job, and it slays at it πŸ‘‘
  • work β€” member used to schedule the release routine. ⚠️ heads up: it may block β€” this is a real caveat, not a drill 😭
  • tcp_tx_work β€” work for deferring outgoing packet processing. TCP only πŸ’œ
πŸ¦‹ quick vibe check: the union means it's either the UDP crew (ovpn + dev_tracker) or the TCP crew (peer) β€” never both at once. iykyk.

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./drivers/net/ovpn/socket.h β€” go read it, it's right there, be so fr

and that's the page!! 🧚 no notes, 10/10, ate and left no crumbs. this lil manual entry came from ./drivers/net/ovpn, dated October 2026 β€” so yeah, it's from the future, main character energy only β­πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from