IPV6_MTU(2const)

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

πŸ’– IPV6_MTU β€” like, the whole vibe πŸ’–

okay bestie, pull up a chair, we're reading IPV6_MTU(2const) together and it's gonna be so good, i promise 🫢


🌸 NAME 🌸

IPV6_MTU β€” path maximum transmission unit size

like... it's the MTU. for the path. that's the whole thing. slay.


πŸŽ€ LIBRARY πŸŽ€

Standard C library (libc, -lc) β€” yes girl, the regular one, nothing fancy ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <netinet/in.h>  /* Definition of IP* constants */
#include <sys/socket.h>

int setsockopt(int sockfd, IPPROTO_IPV6, IPV6_MTU,
               const int *val, sizeof(int));
int getsockopt(int sockfd, IPPROTO_IPV6, IPV6_MTU,
               int *val, sizeof(int));

not me including the exact headers word for word, because i respect you πŸ’…


🌈 DESCRIPTION 🌈

so there's two ways to talk to this option and they are giving totally different energy:

✨ getsockopt() ✨

Retrieve the current known path MTU of the current socket, bestie. That's it, that's the tea.

⚠️ Valid only when the socket has been connected. Not connected? Not valid. No cap. 😭

✨ setsockopt() ✨

Set the MTU to be used for the socket. The MTU is limited by the device MTU or the path MTU when path MTU discovery is enabled.

so like, you can ask for a number, but the device MTU and the path MTU (if path MTU discovery is on) are the ones actually holding the leash 🧚 it's giving "you don't get to pick, the network picks for you" fr fr.


πŸ’€ ERRORS πŸ’€

See IPPROTO_IPV6(2const). See setsockopt(2). See ipv6(7).

(translation: the drama lives in those pages, go read them, i'm not repeating it πŸ“)


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, you ate it, i'm so proud of you πŸ’œ

source + version tea: this is from Linux man-pages 6.20, dated 2025-12-02. 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