IPV6_UNICAST_HOPS(2const)
π IPV6_UNICAST_HOPS(2const) β bestie, it's the unicast hop limit π
okay so you found the IPV6_UNICAST_HOPS(2const) page in section 2, the constants girlies section β¨. Let's get into it, this one is short and sweet but it's so important.
πΈ NAME πΈ
IPV6_UNICAST_HOPS β literally just the unicast hop limit. that's the whole name, no cap π
π§ LIBRARY π§
Standard C library β that's <italic>libc</italic>, link it with -lc and you're golden π
β¨ SYNOPSIS β¨
#include <netinet/in.h> /* Definition of IP* constants */
#include <sys/socket.h>
int setsockopt(int sockfd, IPPROTO_IPV6, IPV6_UNICAST_HOPS,
const int *hops, sizeof(int));
look at that. #include <netinet/in.h> is where all your IP* constants live bestie, and #include <sys/socket.h> is the socket vibe. then you hit setsockopt() with IPPROTO_IPV6 and IPV6_UNICAST_HOPS and hand it a pointer to your int called hops plus sizeof(int). slay π«Ά
π« DESCRIPTION π«
So what does it do? It sets the unicast hop limit for the socket. That's it. That's the whole main character job π
A value of -1 means "just use the route default, I don't wanna pick" β iconic, hands off, let the kernel decide π
Otherwise it should be in the range [0, 255]. Keep it in there, okay? That's the rules π
π ERRORS π
ngl it doesn't relitigate anything here, it just points you at the girlies who actually spill the details:
- See
IPPROTO_IPV6(2const). - See
setsockopt(2). - See
ipv6(7).
π HISTORY π
IPV6_UNICAST_HOPSβ POSIX.1-2001. yes she's been around, a true elder icon β
π¦ SEE ALSO π¦
fr fr bestie, if you're gonna fiddle with hop limits, make sure you actually understand routes first β hop limits are the kind of thing that quietly changes where your packets do or don't go π
and that's the page!! go set some hop limits responsibly, mwah π
also this was brought to you by Linux man-pages 6.20, dated 2026-01-05 β that's the version and the date, periodt πβ¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms