IP_DROP_MEMBERSHIP(2const)

IP_DROP_MEMBERSHIP2const

Leave a multicast group

Usage

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

int setsockopt(int sockfd, IPPROTO_IP, IP_DROP_MEMBERSHIP, const struct ip_mreqn *val, sizeof(struct ip_mreqn));

Library

Standard C library (libc, -lc)

Overview

Leave a multicast group.

Errors

See IPPROTO_IP(2const). See setsockopt(2). See ip(7).

History

Linux 1.2.

For compatibility, the old ip_mreq structure is still supported. The kernel determines which structure is being passed based on the size passed in the last argument.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.