| 1 |
.\" Copyright, the authors of the Linux man-pages project |
| 2 |
.\" |
| 3 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 4 |
.\" |
| 5 |
.TH IP_MULTICAST_TTL 2const 2025-11-25 "Linux man-pages 6.18" |
| 6 |
.SH NAME |
| 7 |
IP_MULTICAST_TTL |
| 8 |
\- |
| 9 |
time-to-live value of outgoing multicast packets |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.BR "#include <netinet/in.h>" " /* Definition of " IP* " constants */" |
| 16 |
.B #include <sys/socket.h> |
| 17 |
.P |
| 18 |
.BI int\~setsockopt(int\~ sockfd ,\~IPPROTO_IP,\~IP_MULTICAST_TTL, |
| 19 |
.BI " const\~int\~*" ttl ,\~sizeof(int)); |
| 20 |
.BI int\~getsockopt(int\~ sockfd ,\~IPPROTO_IP,\~IP_MULTICAST_TTL, |
| 21 |
.BI " int\~*" ttl ,\~sizeof(int)); |
| 22 |
.fi |
| 23 |
.SH DESCRIPTION |
| 24 |
Set or read the time-to-live value of outgoing multicast packets for this |
| 25 |
socket. |
| 26 |
.P |
| 27 |
The default is 1 which means that multicast packets don't leave the local |
| 28 |
network unless the user program explicitly requests it. |
| 29 |
.SH ERRORS |
| 30 |
See |
| 31 |
.BR IPPROTO_IP (2const). |
| 32 |
See |
| 33 |
.BR setsockopt (2). |
| 34 |
See |
| 35 |
.BR ip (7). |
| 36 |
.SH HISTORY |
| 37 |
Linux 1.2. |
| 38 |
.SH CAVEATS |
| 39 |
It is very important for multicast packets to set the smallest TTL possible. |
| 40 |
.SH SEE ALSO |
| 41 |
.BR IPPROTO_IP (2const), |
| 42 |
.BR setsockopt (2), |
| 43 |
.BR ip (7) |