bpf_ksock_connect(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« bpf_ksock_connect(9) β€” a Kernel API Manual moment πŸ’«

okay bestie, welcome to the bpf_ksock_connect(9) page, straight out of the Kernel API Manual ✨ this is the little kfunc that gets your BPF kernel socket actually talking to somebody β€” no cap 🫢


🌸 NAME 🌸

bpf_ksock_connect β€” bestie, it connects a BPF kernel socket to a remote address πŸ’…


✨ SYNOPSIS ✨

__bpf_kfunc int bpf_ksock_connect (struct bpf_ksock *ks , const union bpf_ksock_addr *addr , u32 addr__sz );

like, that's the whole vibe right there ⭐


πŸŽ€ ARGUMENTS πŸŽ€

  • ks β€” your BPF kernel socket context πŸ’– the main character, honestly.
  • addr β€” a pointer to an IPv4 or IPv6 socket address 🌈 either one, she contains multitudes.
  • addr__sz β€” the size of the address union 🧚 just so everyone knows how big the vibe is.

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does she do? She connects the socket to the specified remote address and port πŸ”₯ that's it, that's the whole slay.

But β€” and this is the important part, so listen up πŸ™ˆ β€” this function may sleep while it's connecting the socket. Which means it can only be used in sleepable BPF programs (SYSCALL). Not the regular ones, bestie. Only the sleepable ones. The vibe check here is real 😭


🌟 RETURN 🌟

  • 0 on success πŸ‘‘ periodt.
  • negative errno on error πŸ’€ she'll let you know.

πŸ’œ SEE ALSO πŸ’œ

go read these next, iykyk πŸ“


anyway that's the page!! sourced from ./net/core, dated October 2026 β€” mwah, love u, go connect some sockets responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from