ovpn_dst_cache_current(9)
π ovpn_dst_cache_current(9) β the vibe check for your route lookup
okay bestie, so this is ovpn_dst_cache_current(9) from the Kernel API Manual, and honestly? it's a little bodyguard function. it just checks whether a route lookup still matches what the peer is doing right now. no cap. π«Ά
β¨ SYNOPSIS β¨
bool ovpn_dst_cache_current (const struct ovpn_peer *peer , const struct
ovpn_bind *bind , const struct ovpn_route_key *key );
literally three args, one bool back. iconic signature, no notes. π
π¦ ARGUMENTS π¦
peerβ the peer that owns the bind and the dst cache. it's giving main character energy, everything belongs to it.bindβ the RCU bind used for the route lookup.keyβ the route key used for the route lookup.
πΈ DESCRIPTION πΈ
so here's the tea β β this function checks that bind is still the current peer bind, and that key still matches the peer route key. both of them, bestie. no half-checking.
the caller must hold peer->lock. like, not optional, that's the rule. π
and here's the cute part: the TX path keeps bind inside an RCU read-side critical section, so pointer identity alone is enough to detect whether the bind got replaced while the route lookup was running. obsessed with that for it, honestly. π
π RETURN π
true if the lookup result still matches the current peer state and may update the dst cache or replace the bind. that's the slay condition right there. β¨
π SEE ALSO π
Kernel file ./drivers/net/ovpn/udp.c and the whole friend group:
ovpn_udp_encap_recv(9)ovpn_dst_cache_check_key(9)ovpn_udp4_output(9)ovpn_udp6_output(9)ovpn_udp_output(9)ovpn_udp_send_skb(9)ovpn_udp_socket_attach(9)ovpn_udp_socket_detach(9)
okay that's the whole page, you ate that π β this little gem lives at ./drivers/net/ovpn, dated October 2026, and it's page ovpn_dst_cache_current(9) of the Kernel API Manual. mwah, go read it again, iykyk π π β
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms