IPV6_MULTICAST_IF(2const)

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

✨ IPV6_MULTICAST_IF β€” bestie edition ✨

okay so you're here because you want to pick which network device your multicast packets go OUT of πŸ’… and babes, you came to the right manpage. this is IPV6_MULTICAST_IF, a 2const page, and it's lowkey the whole personality of one socket option. let's get into it πŸ¦‹


🌸 NAME 🌸

IPV6_MULTICAST_IF β€” the local device for a multicast socket πŸŽ€

πŸ“š LIBRARY πŸ“š

Standard C library β€” that's libc, -lc ✨

🩷 SYNOPSIS 🩷

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

int setsockopt(int sockfd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
               const int *ifindex, sizeof(int));
int getsockopt(int sockfd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
               int *ifindex, sizeof(int));

not me dropping both the setter AND the getter like it's nothing 😌 slay.

πŸ’– DESCRIPTION πŸ’–

So the way this works is: it sets the device for outgoing multicast packets on the socket. that's it, that's the job. you're telling the socket "hey bestie, send your multicast vibes out through this network interface specifically" 🌈

⚠️ heads up though β€” this is allowed only for SOCK_DGRAM and SOCK_RAW socket. if your socket isn't one of those two, this is not your moment, iykyk πŸ’€

The argument is a pointer to an interface index (peep netdevice(7) for the whole lore) in an integer. so like, an int, but it's pointing at it. pointer energy πŸ‘‘

😭 ERRORS 😭

ngl this part just points you elsewhere, and honestly? valid of it:

πŸ“œ HISTORY πŸ“œ

  • IPV6_MULTICAST_IF β€” POSIX.1-2001. yes she's old, and yes she still ate πŸ’…

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page bestie, go forth and multicast responsibly 🫢✨

Linux man-pages 6.20 β€” dated 2026-01-05 β€” IPV6_MULTICAST_IF(2const), signing off, no cap πŸ’œ

πŸ“¦ 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