.\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .TH IPV6_MTU 2const 2025-12-02 "Linux man-pages 6.17" .SH NAME IPV6_MTU \- path maximum transmission unit size .SH LIBRARY Standard C library .RI ( libc ,\~ \-lc ) .SH SYNOPSIS .nf .BR "#include " " /* Definition of " IP* " constants */" .B #include .P .BI int\~setsockopt(int\~ sockfd ,\~IPPROTO_IPV6,\~IPV6_MTU, .BI " const\~int\~*" val ,\~sizeof(int)); .BI int\~getsockopt(int\~ sockfd ,\~IPPROTO_IPV6,\~IPV6_MTU, .BI " int\~*" val ,\~sizeof(int)); .fi .SH DESCRIPTION .TP .BR getsockopt (): Retrieve the current known path MTU of the current socket. Valid only when the socket has been connected. .TP .BR 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. .SH ERRORS See .BR IPPROTO_IPV6 (2const). See .BR setsockopt (2). See .BR ipv6 (7). .SH SEE ALSO .BR IPPROTO_IPV6 (2const), .BR setsockopt (2), .BR ipv6 (7)