IPV6_UNICAST_HOPS(2const)

πŸ“¦
version 6.20 Β· 4 versions
, in arch rolling, nixpkgs unstable

πŸ’… 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:


πŸ‘‘ 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