---
name: "IP_DROP_MEMBERSHIP"
section: "2const"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/IP_DROP_MEMBERSHIP"
---

# IP\_DROP\_MEMBERSHIP(2const)

leave a multicast group

## NAME

IP\_DROP\_MEMBERSHIP - leave a multicast group

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#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));**

## DESCRIPTION

Leave a multicast group.

## ERRORS

See [**IPPROTO\_IP**(2const)](/IPPROTO_IP/2const.md). See [**setsockopt**(2)](/setsockopt/2.md). See [**ip**(7)](/ip/7.md).

## 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.

## SEE ALSO

[**IPPROTO\_IP**(2const)](/IPPROTO_IP/2const.md), [**ip\_mreqn**(2type)](/ip_mreqn/2type.md), [**setsockopt**(2)](/setsockopt/2.md), [**ip**(7)](/ip/7.md)
