ovpn_peer_vp...dr_conflict4(9)
πΈ ovpn_peer_vp...dr_conflict4(9) π
okay bestie, welcome to the Kernel API Manual β yes that's the manual name, yes it's fancy, we stay fancy here β¨ this one's a lil' helper from the OpenVPN kernel crew and it's genuinely so simple you're gonna slay it.
β¨ NAME β¨
ovpn_peer_vpn_addr_conflict4 β the vibe check that tells you if a VPN v4 address is already taken π like, is somebody else sitting in your seat, or are you good?
π¦ SYNOPSIS π¦
bool ovpn_peer_vpn_addr_conflict4 (struct ovpn_priv *ovpn , const struct
ovpn_peer *peer , const struct in_addr *addr );
π ARGUMENTS π
ovpnβ the openvpn instance you're searching through π like scrolling the group chat for a specific message.peerβ the peer that's being added or updated, orNULLif there's no peer in the picture π yesNULLis allowed, it's fine, we don't judge.addrβ the VPN IPv4 address you wanna check π the one you're side-eyeing.
π DESCRIPTION π
So here's the tea, bestie: this function checks whether addr is already assigned to another peer. That's it. That's the whole job. π«Ά
And when a match is found, peer gets ignored β which is literally the point, because it means you can do peer updates that keep an existing address without the function throwing hands at you. Iconic behaviour, honestly. π
Also: unspecified addresses are ignored. Not our problem, not today. π
β οΈ NOTE β οΈ
the caller must hold ovpn->lock.
Not optional, not a suggestion, not a "maybe later" β the caller must hold ovpn->lock. Lock it or block it, babes. π
β RETURN β
true on conflict, false otherwise. Boom. Binary. Periodt. π
π SEE ALSO π
Kernel file ./drivers/net/ovpn/peer.c plus this whole gorgeous extended universe of sibling functions, all of them (9) and all of them eating:
ovpn_peer_keepalive_set(9)ovpn_peer_keepalive_send(9)ovpn_peer_new(9)ovpn_peer_reset_sockaddr(9)ovpn_peer_endpoints_update(9)ovpn_peer_release_rcu(9)ovpn_peer_release(9)ovpn_peer_release_kref(9)ovpn_peer_skb_to_sockaddr(9)ovpn_nexthop_from_skb4(9)ovpn_nexthop_from_skb6(9)ovpn_peer_get_by_vpn_addr4(9)ovpn_peer_get_by_vpn_addr6(9)ovpn_peer_vpn_addr_conflict6(9)ovpn_peer_transp_match(9)ovpn_peer_get_by_transp_addr_p2p(9)ovpn_peer_get_by_transp_addr(9)ovpn_peer_get_by_id_p2p(9)ovpn_peer_get_by_id(9)ovpn_peer_get_by_dst(9)ovpn_nexthop_from_rt4(9)ovpn_nexthop_from_rt6(9)ovpn_peer_check_by_src(9)ovpn_peer_add_mp(9)ovpn_peer_add_p2p(9)ovpn_peer_add(9)ovpn_peer_del_mp(9)ovpn_peer_del_p2p(9)ovpn_peer_del(9)ovpn_peer_release_p2p(9)ovpn_peers_free(9)ovpn_peer_keepalive_work(9)
okay that's the page! π§ this lil' baddie lives in ./drivers/net/ovpn and it's stamped October 2026 β go forth, check those addresses, hold that lock, and remember: no cap, false means you're free to add πβ¨π
π¦ 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