ip_mreqn(2type)
๐ ip_mreqn โ the manual page, but make it make sense ๐
okay so bestie, welcome to the โจ ip_mreqn โจ show. this is a page from section 2type, which is basically the corner of the manual where struct definitions live. we got two structs here โ ip_mreqn and its slightly older sibling ip_mreq โ and they're both about telling the kernel "hey. i want in on this multicast group. here's where i'm standing and which door i'm using." ๐ฌ no cap.
and it lives in the Standard C library (libc), so you don't even gotta go hunting for it. it's right there. ๐ซถ
๐ธ SYNOPSIS ๐ธ
grab this header first, she's the one who brings all the IP* constants to the party:
#include <netinet/in.h> /* Definition of IP* constants */
then here's the big one, the newer girl, ip_mreqn:
struct ip_mreqn {
struct in_addr imr_multiaddr; /* IP multicast group address */
struct in_addr imr_address; /* IP address of local interface */
int imr_ifindex; /* interface index */
};
and here's the classic, ip_mreq โ shorter, no imr_ifindex, still iconic:
struct ip_mreq {
struct in_addr imr_multiaddr; /* IP multicast group address */
struct in_addr imr_address; /* IP address of local interface */
};
โจ DESCRIPTION โจ
okay so let's go field by field, because each one is doing its own lil job and you gotta know which one is which ๐
.imr_multiaddrโ this is the address of the multicast group your app wants to join or leave. and listen, it must be a valid multicast address. like, that's not optional. the kernel will not be playing games w you on this one. ๐ซ๐ฎ.imr_addressโ the address of the local interface that the system should use to join the multicast group. and here's the cute part: if it's equal toINADDR_ANY, then the system just picks an appropriate interface for you. it's giving "you choose, i trust you." ๐๐ท.imr_ifindexโ the interface index of the interface that should join/leave the.imr_multiaddrgroup. orrrr you set it to0to indicate any interface. yes bestie,0means "any", that's not a typo, that's the vibe. ๐
๐ฆ HISTORY ๐ฆ
ip_mreqnโ Linux2.2. the newer era. the glow-up. โจip_mreqโ Linux1.2. the og. respect her. ๐
๐ SEE ALSO ๐
go read these next, they're the whole friend group fr fr:
quick recap bestie: valid multicast addr in.imr_multiaddr, local interface addr in.imr_address(orINADDR_ANYand let the system cook ๐ณ), and.imr_ifindexfor the interface โ or0for any. that's the whole assignment. you got this. ๐
and that's the page!! ๐ซถ this lil slice of documentation came from Linux man-pages 6.20, dated 2025-11-25 โ so yeah, she's recent, she's fresh, she ate. ๐ ๐ now go join a multicast group, main character. ๐๐ฆ๐ธ
๐ฆ 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