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

# IPV6\_MTU(2const)

path maximum transmission unit size

## NAME

IPV6\_MTU - path maximum transmission unit size

## LIBRARY

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

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

## DESCRIPTION

- **getsockopt**():

  Retrieve the current known path MTU of the current socket. Valid only when the socket has been connected.

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

## ERRORS

See [**IPPROTO\_IPV6**(2const)](/IPPROTO_IPV6/2const.md). See [**setsockopt**(2)](/setsockopt/2.md). See [**ipv6**(7)](/ipv6/7.md).

## SEE ALSO

[**IPPROTO\_IPV6**(2const)](/IPPROTO_IPV6/2const.md), [**setsockopt**(2)](/setsockopt/2.md), [**ipv6**(7)](/ipv6/7.md)
