2008-08-08 16:41:48 +00:00
|
|
|
.\" This man page is Copyright (C) 1999 Andi Kleen <ak@muc.de>.
|
ldd.1, capget.2, clone.2, create_module.2, fallocate.2, futex.2, get_kernel_syms.2, get_thread_area.2, getcpu.2, getitimer.2, getpid.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioctl_list.2, mkdir.2, mknod.2, pciconfig_read.2, pivot_root.2, posix_fadvise.2, query_module.2, sendfile.2, set_thread_area.2, setns.2, unshare.2, __setfpucw.3, a64l.3, addseverity.3, argz_add.3, bindresvport.3, cabs.3, cacos.3, cacosh.3, canonicalize_file_name.3, carg.3, casin.3, casinh.3, catan.3, catanh.3, ccos.3, ccosh.3, cerf.3, cexp.3, cexp2.3, cimag.3, clog.3, clog10.3, clog2.3, cmsg.3, conj.3, cpow.3, cproj.3, creal.3, csin.3, csinh.3, csqrt.3, ctan.3, ctanh.3, des_crypt.3, envz_add.3, fdim.3, fma.3, fmax.3, fmemopen.3, fmin.3, fmtmsg.3, fpclassify.3, gamma.3, getpt.3, getrpcent.3, getrpcport.3, getttyent.3, isgreater.3, key_setsecret.3, lgamma.3, malloc_hook.3, mempcpy.3, nan.3, netlink.3, nextafter.3, putgrent.3, remove.3, remquo.3, rpc.3, rtime.3, rtnetlink.3, setaliasent.3, setnetgrent.3, signbit.3, significand.3, sincos.3, stdin.3, tgamma.3, xcrypt.3, xdr.3, cciss.4, hpsa.4, mouse.4, pts.4, sk98lin.4, tty_ioctl.4, wavelan.4, hosts.equiv.5, rpc.5, tzfile.5, boot.7, complex.7, ddp.7, fifo.7, futex.7, icmp.7, ip.7, ipv6.7, netdevice.7, netlink.7, packet.7, raw.7, rtnetlink.7, socket.7, tcp.7, udp.7, unix.7, x25.7, sync.8: Global fix: Put copyright info at top of page, followed by blank line and LICENSE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-10 09:29:51 +00:00
|
|
|
.\"
|
getcpu.2, sendfile.2, cmsg.3, rtnetlink.3, arp.7, ddp.7, fifo.7, icmp.7, ip.7, ipv6.7, netdevice.7, packet.7, raw.7, rtnetlink.7, socket.7, tcp.7, udp.7, unix.7, x25.7: LICENSE_START(VERBATIM_ONE_PARA)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-10 09:29:00 +00:00
|
|
|
.\" %%%LICENSE_START(VERBATIM_ONE_PARA)
|
2008-08-08 16:41:48 +00:00
|
|
|
.\" Permission is granted to distribute possibly modified copies
|
|
|
|
.\" of this page provided the header is included verbatim,
|
|
|
|
.\" and in case of nontrivial modification author and date
|
|
|
|
.\" of the modification is added to the header.
|
epoll_create.2, epoll_ctl.2, epoll_wait.2, eventfd.2, fallocate.2, futex.2, getcpu.2, getitimer.2, ioctl_list.2, ioprio_set.2, migrate_pages.2, move_pages.2, pciconfig_read.2, sendfile.2, setns.2, signalfd.2, spu_create.2, spu_run.2, sysinfo.2, timerfd_create.2, backtrace.3, cmsg.3, error.3, getpt.3, getrpcent.3, getrpcport.3, getsubopt.3, offsetof.3, program_invocation_name.3, rpc.3, rpmatch.3, rtnetlink.3, xdr.3, cciss.4, hpsa.4, pts.4, charmap.5, dir_colors.5, elf.5, gai.conf.5, locale.5, nscd.conf.5, nss.5, resolv.conf.5, rpc.5, arp.7, cpuset.7, ddp.7, epoll.7, fifo.7, futex.7, icmp.7, ip.7, ipv6.7, mailaddr.7, netdevice.7, packet.7, raw.7, regex.7, rtnetlink.7, socket.7, spufs.7, tcp.7, udp.7, unix.7, x25.7, ldconfig.8, nscd.8: Global fix: s/END_LICENSE/LICENSE_END/
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-12 09:26:07 +00:00
|
|
|
.\" %%%LICENSE_END
|
networks.5, arp.7, cp1251.7, ddp.7, icmp.7, ip.7, ipv6.7, iso_8859-10.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-9.7, koi8-r.7, netdevice.7, netlink.7, packet.7, raw.7, rtnetlink.7, udp.7, x25.7, ld.so.8, sln.8, sync.8: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-12 11:28:50 +00:00
|
|
|
.\"
|
2008-08-08 16:41:48 +00:00
|
|
|
.\" $Id: ip.7,v 1.19 2000/12/20 18:10:31 ak Exp $
|
2010-09-11 05:08:30 +00:00
|
|
|
.\"
|
adjtimex.2, bind.2, cacheflush.2, clone.2, fallocate.2, fanotify_init.2, fanotify_mark.2, flock.2, futex.2, getdents.2, getpriority.2, getrlimit.2, gettid.2, gettimeofday.2, ioprio_set.2, kexec_load.2, migrate_pages.2, modify_ldt.2, mount.2, move_pages.2, mprotect.2, msgop.2, nfsservctl.2, perf_event_open.2, pread.2, ptrace.2, recvmmsg.2, rename.2, restart_syscall.2, sched_setattr.2, send.2, shmop.2, shutdown.2, sigaction.2, signalfd.2, syscalls.2, timer_create.2, timerfd_create.2, tkill.2, vmsplice.2, wait.2, aio_init.3, confstr.3, exit.3, fmemopen.3, fopen.3, getaddrinfo.3, getauxval.3, getspnam.3, isalpha.3, isatty.3, mallinfo.3, malloc.3, mallopt.3, psignal.3, pthread_attr_setinheritsched.3, qecvt.3, queue.3, rtnetlink.3, strerror.3, strftime.3, toupper.3, towlower.3, towupper.3, initrd.4, locale.5, proc.5, bootparam.7, capabilities.7, ddp.7, fanotify.7, icmp.7, inotify.7, ip.7, ipv6.7, netdevice.7, netlink.7, path_resolution.7, rtld-audit.7, rtnetlink.7, sched.7, signal.7, socket.7, svipc.7, tcp.7, unix.7, ld.so.8: srcfix: Update FIXMEs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-08-21 21:47:44 +00:00
|
|
|
.\" FIXME The following socket options are yet to be documented
|
2016-10-29 10:45:35 +00:00
|
|
|
.\"
|
2012-12-15 15:25:28 +00:00
|
|
|
.\" IP_XFRM_POLICY (2.5.48)
|
|
|
|
.\" Needs CAP_NET_ADMIN
|
2016-10-29 10:45:35 +00:00
|
|
|
.\"
|
2012-12-15 15:25:28 +00:00
|
|
|
.\" IP_IPSEC_POLICY (2.5.47)
|
|
|
|
.\" Needs CAP_NET_ADMIN
|
2016-10-29 10:45:35 +00:00
|
|
|
.\"
|
2012-12-15 15:25:28 +00:00
|
|
|
.\" IP_MINTTL (2.6.34)
|
|
|
|
.\" commit d218d11133d888f9745802146a50255a4781d37a
|
|
|
|
.\" Author: Stephen Hemminger <shemminger@vyatta.com>
|
2016-10-29 10:45:35 +00:00
|
|
|
.\"
|
2012-12-15 15:25:28 +00:00
|
|
|
.\" MCAST_JOIN_GROUP (2.4.22 / 2.6)
|
2016-10-29 10:45:35 +00:00
|
|
|
.\"
|
2012-12-15 15:25:28 +00:00
|
|
|
.\" MCAST_BLOCK_SOURCE (2.4.22 / 2.6)
|
2016-10-29 10:45:35 +00:00
|
|
|
.\"
|
2012-12-15 15:25:28 +00:00
|
|
|
.\" MCAST_UNBLOCK_SOURCE (2.4.22 / 2.6)
|
2016-10-29 10:45:35 +00:00
|
|
|
.\"
|
2012-12-15 15:25:28 +00:00
|
|
|
.\" MCAST_LEAVE_GROUP (2.4.22 / 2.6)
|
2016-10-29 10:45:35 +00:00
|
|
|
.\"
|
2012-12-15 15:25:28 +00:00
|
|
|
.\" MCAST_JOIN_SOURCE_GROUP (2.4.22 / 2.6)
|
2016-10-29 10:45:35 +00:00
|
|
|
.\"
|
2012-12-15 15:25:28 +00:00
|
|
|
.\" MCAST_LEAVE_SOURCE_GROUP (2.4.22 / 2.6)
|
2016-10-29 10:45:35 +00:00
|
|
|
.\"
|
2012-12-15 15:25:28 +00:00
|
|
|
.\" MCAST_MSFILTER (2.4.22 / 2.6)
|
2016-10-29 10:45:35 +00:00
|
|
|
.\"
|
2012-12-15 15:25:28 +00:00
|
|
|
.\" IP_UNICAST_IF (3.4)
|
|
|
|
.\" commit 76e21053b5bf33a07c76f99d27a74238310e3c71
|
|
|
|
.\" Author: Erich E. Hoover <ehoover@mines.edu>
|
2010-09-11 05:08:30 +00:00
|
|
|
.\"
|
iconv.1, locale.1, memusage.1, memusagestat.1, pldd.1, sprof.1, _syscall.2, add_key.2, adjtimex.2, bind.2, bpf.2, chown.2, clone.2, close.2, copy_file_range.2, eventfd.2, fanotify_init.2, fanotify_mark.2, fork.2, fsync.2, futex.2, getdents.2, getrlimit.2, getxattr.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, ioctl_fat.2, ioctl_getfsmap.2, ioctl_ns.2, ioctl_tty.2, ioctl_userfaultfd.2, kcmp.2, keyctl.2, listen.2, listxattr.2, mbind.2, membarrier.2, memfd_create.2, mkdir.2, move_pages.2, mremap.2, msync.2, nfsservctl.2, open.2, perf_event_open.2, pidfd_send_signal.2, pipe.2, pivot_root.2, pkey_alloc.2, process_vm_readv.2, ptrace.2, readlink.2, readv.2, recv.2, recvmmsg.2, rename.2, request_key.2, s390_runtime_instr.2, sched_setaffinity.2, seccomp.2, send.2, sendmmsg.2, sigaltstack.2, signalfd.2, socket.2, socketpair.2, splice.2, spu_create.2, spu_run.2, statfs.2, syscall.2, sysctl.2, sysfs.2, tee.2, timer_getoverrun.2, timer_settime.2, umount.2, userfaultfd.2, utimensat.2, wait4.2, INFINITY.3, __ppc_get_timebase.3, __setfpucw.3, abort.3, aio_cancel.3, aio_error.3, aio_read.3, aio_return.3, atexit.3, backtrace.3, basename.3, bsearch.3, bswap.3, cacos.3, cacosh.3, catan.3, catanh.3, cexp2.3, clock_getcpuclockid.3, clog2.3, cmsg.3, confstr.3, div.3, dl_iterate_phdr.3, dlerror.3, dlinfo.3, dlopen.3, dlsym.3, duplocale.3, encrypt.3, end.3, endian.3, envz_add.3, err.3, expm1.3, fdim.3, flockfile.3, fmtmsg.3, frexp.3, ftw.3, get_nprocs_conf.3, get_phys_pages.3, getaddrinfo_a.3, getauxval.3, getdate.3, getdtablesize.3, getgrent_r.3, getgrouplist.3, gethostbyname.3, getline.3, getnameinfo.3, getopt.3, getprotoent_r.3, getpwent_r.3, getpwnam.3, getservent_r.3, getsubopt.3, getutent.3, glob.3, gnu_get_libc_version.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_ntop.3, inet_pton.3, insque.3, killpg.3, makecontext.3, mallinfo.3, malloc.3, malloc_hook.3, malloc_info.3, mallopt.3, matherr.3, mbsnrtowcs.3, mbstowcs.3, mcheck.3, mempcpy.3, mq_getattr.3, mq_notify.3, mtrace.3, newlocale.3, nextafter.3, ntp_gettime.3, offsetof.3, open_memstream.3, pow.3, printf.3, pthread_attr_init.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setstack.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_create.3, pthread_detach.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_join.3, pthread_mutex_consistent.3, pthread_mutexattr_setrobust.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_spin_init.3, pthread_testcancel.3, pthread_tryjoin_np.3, ptsname.3, qsort.3, rand.3, random.3, remainder.3, rpmatch.3, rtime.3, rtnetlink.3, scalb.3, scalbln.3, scandir.3, sem_getvalue.3, sem_wait.3, setaliasent.3, setlogmask.3, sigwait.3, sincos.3, sockatmark.3, stdarg.3, stpcpy.3, strcat.3, strfmon.3, strptime.3, strtod.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, tsearch.3, uselocale.3, wcstok.3, wcstombs.3, wordexp.3, y0.3, loop.4, vcs.4, veth.4, charmap.5, core.5, filesystems.5, gai.conf.5, hosts.5, hosts.equiv.5, locale.5, nss.5, repertoiremap.5, securetty.5, shells.5, ttytype.5, ascii.7, complex.7, cpuset.7, credentials.7, fanotify.7, hier.7, inotify.7, ip.7, mount_namespaces.7, mq_overview.7, netlink.7, network_namespaces.7, pid_namespaces.7, pkeys.7, rtld-audit.7, rtnetlink.7, sem_overview.7, signal-safety.7, sock_diag.7, spufs.7, standards.7, symlink.7, tcp.7, time_namespaces.7, unix.7, user_namespaces.7, xattr.7, ldconfig.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 12:43:54 +00:00
|
|
|
.TH IP 7 2020-06-09 "Linux" "Linux Programmer's Manual"
|
2008-08-08 16:41:48 +00:00
|
|
|
.SH NAME
|
|
|
|
ip \- Linux IPv4 protocol implementation
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B #include <sys/socket.h>
|
|
|
|
.br
|
|
|
|
.\" .B #include <net/netinet.h> -- does not exist anymore
|
|
|
|
.\" .B #include <linux/errqueue.h> -- never include <linux/foo.h>
|
|
|
|
.B #include <netinet/in.h>
|
|
|
|
.br
|
|
|
|
.B #include <netinet/ip.h> \fR/* superset of previous */
|
_exit.2, bpf.2, cacheflush.2, capget.2, chdir.2, chmod.2, chroot.2, clock_getres.2, clock_nanosleep.2, close.2, connect.2, create_module.2, dup.2, epoll_create.2, epoll_ctl.2, epoll_wait.2, eventfd.2, execve.2, execveat.2, exit_group.2, fanotify_mark.2, flock.2, fork.2, fsync.2, futex.2, futimesat.2, get_kernel_syms.2, get_mempolicy.2, get_robust_list.2, getcpu.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getitimer.2, getpagesize.2, getpeername.2, getpid.2, getpriority.2, getrandom.2, getresuid.2, getrlimit.2, getrusage.2, getsid.2, getsockname.2, getsockopt.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, getxattr.2, idle.2, inotify_add_watch.2, inotify_init.2, inotify_rm_watch.2, ioctl.2, ioctl_fat.2, ioctl_ficlonerange.2, ioctl_fideduperange.2, ioctl_getfsmap.2, ioctl_tty.2, ioperm.2, iopl.2, keyctl.2, kill.2, link.2, listen.2, listxattr.2, llseek.2, lseek.2, madvise.2, mbind.2, membarrier.2, memfd_create.2, migrate_pages.2, mincore.2, mkdir.2, mknod.2, mlock.2, mmap.2, mmap2.2, modify_ldt.2, mount.2, move_pages.2, mprotect.2, mq_getsetattr.2, mremap.2, msgop.2, msync.2, nanosleep.2, nfsservctl.2, nice.2, pause.2, pciconfig_read.2, perf_event_open.2, perfmonctl.2, personality.2, pkey_alloc.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, ptrace.2, query_module.2, read.2, readahead.2, readdir.2, readv.2, reboot.2, recv.2, remap_file_pages.2, removexattr.2, rename.2, request_key.2, rmdir.2, rt_sigqueueinfo.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, send.2, sendfile.2, set_mempolicy.2, set_tid_address.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setns.2, setpgid.2, setresuid.2, setreuid.2, setsid.2, setuid.2, setup.2, setxattr.2, sgetmask.2, shmctl.2, shmget.2, shutdown.2, sigaction.2, sigaltstack.2, sigpending.2, sigprocmask.2, sigsuspend.2, sigwaitinfo.2, socket.2, socketcall.2, socketpair.2, stat.2, statfs.2, stime.2, swapon.2, symlink.2, sync.2, sysctl.2, sysinfo.2, syslog.2, time.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, timerfd_create.2, times.2, tkill.2, truncate.2, umask.2, umount.2, uname.2, unlink.2, unshare.2, uselib.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vfork.2, vhangup.2, vm86.2, wait.2, wait4.2, write.2, CPU_SET.3, INFINITY.3, __ppc_get_timebase.3, __ppc_set_ppr_med.3, __ppc_yield.3, __setfpucw.3, a64l.3, abort.3, abs.3, acos.3, acosh.3, addseverity.3, adjtime.3, aio_cancel.3, aio_error.3, aio_fsync.3, aio_init.3, aio_read.3, aio_return.3, aio_suspend.3, aio_write.3, alloca.3, argz_add.3, asin.3, asinh.3, asprintf.3, assert.3, assert_perror.3, atan.3, atan2.3, atanh.3, atexit.3, atof.3, atoi.3, basename.3, bcmp.3, bcopy.3, bsd_signal.3, bsearch.3, bstring.3, btowc.3, byteorder.3, cabs.3, cacos.3, cacosh.3, canonicalize_file_name.3, carg.3, casin.3, casinh.3, catan.3, catanh.3, catopen.3, cbrt.3, ccos.3, ccosh.3, ceil.3, cexp.3, cexp2.3, cfree.3, cimag.3, clearenv.3, clock.3, clock_getcpuclockid.3, clog.3, clog10.3, clog2.3, closedir.3, cmsg.3, confstr.3, conj.3, copysign.3, cos.3, cosh.3, cpow.3, cproj.3, creal.3, crypt.3, csin.3, csinh.3, csqrt.3, ctan.3, ctanh.3, ctermid.3, ctime.3, daemon.3, difftime.3, dirfd.3, div.3, dlerror.3, dlopen.3, dlsym.3, drand48.3, drand48_r.3, duplocale.3, dysize.3, ecvt.3, ecvt_r.3, encrypt.3, endian.3, erf.3, erfc.3, err.3, errno.3, ether_aton.3, euidaccess.3, exec.3, exit.3, exp.3, exp10.3, exp2.3, expm1.3, fabs.3, fclose.3, fcloseall.3, fdim.3, fenv.3, ferror.3, fexecve.3, fflush.3, ffs.3, fgetc.3, fgetgrent.3, fgetpwent.3, fgetwc.3, fgetws.3, finite.3, flockfile.3, floor.3, fma.3, fmax.3, fmemopen.3, fmin.3, fmod.3, fmtmsg.3, fnmatch.3, fopen.3, fpathconf.3, fpclassify.3, fpurge.3, fputwc.3, fputws.3, fread.3, frexp.3, fseek.3, fseeko.3, ftime.3, ftok.3, fts.3, ftw.3, futimes.3, fwide.3, gamma.3, gcvt.3, get_nprocs_conf.3, get_phys_pages.3, getaddrinfo.3, getaddrinfo_a.3, getauxval.3, getcontext.3, getcwd.3, getdate.3, getdirentries.3, getdtablesize.3, getentropy.3, getenv.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getifaddrs.3, getipnodebyname.3, getline.3, getloadavg.3, getlogin.3, getmntent.3, getnameinfo.3, getnetent.3, getnetent_r.3, getopt.3, getpass.3, getprotoent.3, getprotoent_r.3, getpt.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent_r.3, getrpcport.3, gets.3, getservent.3, getservent_r.3, getspnam.3, getsubopt.3, getttyent.3, getumask.3, getusershell.3, getutent.3, getw.3, getwchar.3, glob.3, grantpt.3, group_member.3, gsignal.3, hsearch.3, hypot.3, iconv.3, iconv_close.3, iconv_open.3, if_nameindex.3, if_nametoindex.3, ilogb.3, index.3, inet.3, inet_net_pton.3, inet_ntop.3, infnan.3, initgroups.3, insque.3, isalpha.3, isatty.3, isfdtype.3, isgreater.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, j0.3, key_setsecret.3, killpg.3, ldexp.3, lgamma.3, localeconv.3, lockf.3, log.3, log10.3, log1p.3, log2.3, logb.3, login.3, lrint.3, lround.3, lsearch.3, lseek64.3, makecontext.3, malloc.3, malloc_get_state.3, malloc_hook.3, malloc_info.3, matherr.3, mblen.3, mbrlen.3, mbrtowc.3, mbsinit.3, mbsnrtowcs.3, mbsrtowcs.3, mbstowcs.3, mbtowc.3, mcheck.3, memccpy.3, memchr.3, memcmp.3, memcpy.3, memfrob.3, memmem.3, memmove.3, mempcpy.3, memset.3, mkdtemp.3, mkfifo.3, mkstemp.3, mktemp.3, modf.3, mpool.3, mq_close.3, mq_getattr.3, mq_notify.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, mtrace.3, nan.3, netlink.3, newlocale.3, nextafter.3, nl_langinfo.3, offsetof.3, on_exit.3, open_memstream.3, opendir.3, openpty.3, perror.3, popen.3, posix_fallocate.3, posix_madvise.3, posix_memalign.3, posix_openpt.3, pow.3, pow10.3, printf.3, profil.3, psignal.3, pthread_atfork.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_detach.3, pthread_equal.3, pthread_exit.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_join.3, pthread_kill.3, pthread_rwlockattr_setkind_np.3, pthread_self.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_setschedprio.3, pthread_sigmask.3, pthread_sigqueue.3, pthread_testcancel.3, pthread_tryjoin_np.3, pthread_yield.3, ptsname.3, putenv.3, putgrent.3, putpwent.3, puts.3, putwchar.3, qecvt.3, qsort.3, raise.3, rand.3, random.3, random_r.3, rcmd.3, re_comp.3, readdir.3, realpath.3, remainder.3, remove.3, remquo.3, resolver.3, rewinddir.3, rexec.3, rint.3, round.3, rpmatch.3, rtime.3, rtnetlink.3, scalb.3, scalbln.3, scandir.3, scanf.3, sched_getcpu.3, seekdir.3, sem_close.3, sem_destroy.3, sem_getvalue.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sem_wait.3, setaliasent.3, setbuf.3, setenv.3, setlocale.3, setlogmask.3, setnetgrent.3, shm_open.3, siginterrupt.3, signbit.3, significand.3, sigpause.3, sigqueue.3, sigset.3, sigvec.3, sigwait.3, sin.3, sincos.3, sinh.3, sleep.3, sockatmark.3, sqrt.3, statvfs.3, stdarg.3, stdio.3, stdio_ext.3, stpcpy.3, stpncpy.3, strcasecmp.3, strcat.3, strchr.3, strcmp.3, strcoll.3, strcpy.3, strdup.3, strerror.3, strfmon.3, strfromd.3, strfry.3, strftime.3, strlen.3, strnlen.3, strpbrk.3, strptime.3, strsep.3, strsignal.3, strspn.3, strstr.3, strtod.3, strtoimax.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, strxfrm.3, swab.3, sysconf.3, syslog.3, system.3, sysv_signal.3, tan.3, tanh.3, tcgetpgrp.3, tcgetsid.3, telldir.3, tempnam.3, termios.3, tgamma.3, timegm.3, timeradd.3, tmpfile.3, tmpnam.3, toascii.3, toupper.3, towctrans.3, towlower.3, towupper.3, trunc.3, tsearch.3, ttyname.3, ttyslot.3, tzset.3, ualarm.3, ulimit.3, ungetwc.3, unlocked_stdio.3, unlockpt.3, updwtmp.3, uselocale.3, usleep.3, wcpcpy.3, wcpncpy.3, wcrtomb.3, wcscasecmp.3, wcscat.3, wcschr.3, wcscmp.3, wcscpy.3, wcscspn.3, wcsdup.3, wcslen.3, wcsncasecmp.3, wcsncat.3, wcsncmp.3, wcsncpy.3, wcsnlen.3, wcsnrtombs.3, wcspbrk.3, wcsrchr.3, wcsrtombs.3, wcsspn.3, wcsstr.3, wcstoimax.3, wcstok.3, wcstombs.3, wcswidth.3, wctob.3, wctomb.3, wctrans.3, wctype.3, wcwidth.3, wmemchr.3, wmemcmp.3, wmemcpy.3, wmemmove.3, wmemset.3, wordexp.3, wprintf.3, xcrypt.3, y0.3, dsp56k.4, random.4, rtc.4, st.4, ddp.7, ip.7, ipv6.7, packet.7, rtnetlink.7, socket.7, tcp.7, udp.7, udplite.7, x25.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-15 15:16:29 +00:00
|
|
|
.PP
|
2008-08-08 16:47:53 +00:00
|
|
|
.IB tcp_socket " = socket(AF_INET, SOCK_STREAM, 0);"
|
2008-08-08 16:41:48 +00:00
|
|
|
.br
|
2008-08-08 16:47:53 +00:00
|
|
|
.IB udp_socket " = socket(AF_INET, SOCK_DGRAM, 0);"
|
2008-08-08 16:41:48 +00:00
|
|
|
.br
|
2008-08-08 16:47:53 +00:00
|
|
|
.IB raw_socket " = socket(AF_INET, SOCK_RAW, " protocol ");"
|
2008-08-08 16:41:48 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
Linux implements the Internet Protocol, version 4,
|
|
|
|
described in RFC\ 791 and RFC\ 1122.
|
|
|
|
.B ip
|
2008-11-22 03:02:45 +00:00
|
|
|
contains a level 2 multicasting implementation conforming to RFC\ 1112.
|
2008-08-08 16:41:48 +00:00
|
|
|
It also contains an IP router including a packet filter.
|
|
|
|
.PP
|
2008-11-24 15:28:30 +00:00
|
|
|
The programming interface is BSD-sockets compatible.
|
2008-08-08 16:41:48 +00:00
|
|
|
For more information on sockets, see
|
|
|
|
.BR socket (7).
|
|
|
|
.PP
|
2015-05-06 09:52:59 +00:00
|
|
|
An IP socket is created using
|
|
|
|
.BR socket (2):
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.PP
|
2015-05-06 09:52:59 +00:00
|
|
|
socket(AF_INET, socket_type, protocol);
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.PP
|
2020-04-23 09:12:05 +00:00
|
|
|
Valid socket types include
|
2008-08-08 16:41:48 +00:00
|
|
|
.B SOCK_STREAM
|
2020-04-23 09:12:05 +00:00
|
|
|
to open a stream socket,
|
2008-08-08 16:41:48 +00:00
|
|
|
.B SOCK_DGRAM
|
2020-04-23 09:12:05 +00:00
|
|
|
to open a datagram socket, and
|
2008-08-08 16:41:48 +00:00
|
|
|
.B SOCK_RAW
|
|
|
|
to open a
|
|
|
|
.BR raw (7)
|
|
|
|
socket to access the IP protocol directly.
|
2020-04-23 09:12:05 +00:00
|
|
|
.PP
|
2008-08-08 16:41:48 +00:00
|
|
|
.I protocol
|
|
|
|
is the IP protocol in the IP header to be received or sent.
|
2020-04-23 09:12:05 +00:00
|
|
|
Valid values for
|
2008-08-08 16:41:48 +00:00
|
|
|
.I protocol
|
2020-04-23 09:12:05 +00:00
|
|
|
include:
|
|
|
|
.IP \(bu 2
|
|
|
|
0 and
|
2008-08-08 16:41:48 +00:00
|
|
|
.B IPPROTO_TCP
|
2020-04-23 09:12:05 +00:00
|
|
|
for
|
|
|
|
.BR tcp (7)
|
|
|
|
stream sockets;
|
|
|
|
.IP \(bu
|
|
|
|
0 and
|
2008-08-08 16:41:48 +00:00
|
|
|
.B IPPROTO_UDP
|
2020-04-23 09:12:05 +00:00
|
|
|
for
|
|
|
|
.BR udp (7)
|
|
|
|
datagram sockets;
|
|
|
|
.IP \(bu
|
|
|
|
.B IPPROTO_SCTP
|
|
|
|
for
|
|
|
|
.BR sctp (7)
|
|
|
|
stream sockets; and
|
|
|
|
.IP \(bu
|
|
|
|
.B IPPROTO_UDPLITE
|
|
|
|
for
|
|
|
|
.BR udplite (7)
|
|
|
|
datagram sockets.
|
|
|
|
.PP
|
2008-08-08 16:41:48 +00:00
|
|
|
For
|
|
|
|
.B SOCK_RAW
|
2008-11-22 03:02:45 +00:00
|
|
|
you may specify a valid IANA IP protocol defined in
|
|
|
|
RFC\ 1700 assigned numbers.
|
2008-08-08 16:41:48 +00:00
|
|
|
.PP
|
|
|
|
When a process wants to receive new incoming packets or connections, it
|
|
|
|
should bind a socket to a local interface address using
|
|
|
|
.BR bind (2).
|
2013-02-12 21:43:21 +00:00
|
|
|
In this case, only one IP socket may be bound to any given local
|
|
|
|
(address, port) pair.
|
2008-08-08 16:41:48 +00:00
|
|
|
When
|
|
|
|
.B INADDR_ANY
|
2008-11-22 02:51:43 +00:00
|
|
|
is specified in the bind call, the socket will be bound to
|
2008-08-08 16:41:48 +00:00
|
|
|
.I all
|
|
|
|
local interfaces.
|
|
|
|
When
|
|
|
|
.BR listen (2)
|
2013-02-12 21:43:21 +00:00
|
|
|
is called on an unbound socket, the socket is automatically bound
|
|
|
|
to a random free port with the local address set to
|
|
|
|
.BR INADDR_ANY .
|
|
|
|
When
|
2008-08-08 16:41:48 +00:00
|
|
|
.BR connect (2)
|
2013-02-12 21:43:21 +00:00
|
|
|
is called on an unbound socket, the socket is automatically bound
|
2013-02-12 21:47:48 +00:00
|
|
|
to a random free port or to a usable shared port with the local address
|
2013-02-12 21:43:21 +00:00
|
|
|
set to
|
2008-08-08 16:41:48 +00:00
|
|
|
.BR INADDR_ANY .
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.PP
|
2008-08-08 16:41:48 +00:00
|
|
|
A TCP local socket address that has been bound is unavailable for
|
2008-11-22 03:02:45 +00:00
|
|
|
some time after closing, unless the
|
2008-08-08 16:41:48 +00:00
|
|
|
.B SO_REUSEADDR
|
|
|
|
flag has been set.
|
2008-11-22 03:02:45 +00:00
|
|
|
Care should be taken when using this flag as it makes TCP less reliable.
|
intro.1, time.1, _syscall.2, accept.2, brk.2, capget.2, faccessat.2, futimesat.2, gethostname.2, intro.2, ioprio_set.2, kill.2, madvise.2, mlock.2, mount.2, msgget.2, perf_event_open.2, poll.2, readv.2, sched_rr_get_interval.2, sched_setscheduler.2, select.2, select_tut.2, shmget.2, stat.2, timer_create.2, ustat.2, vfork.2, wait.2, alloca.3, atexit.3, catopen.3, crypt.3, dbopen.3, fenv.3, fopen.3, getaddrinfo_a.3, gethostbyname.3, getutent.3, intro.3, login.3, mallopt.3, queue.3, regex.3, sigpause.3, sigsetops.3, stdio.3, strftime.3, strptime.3, sysconf.3, ttyslot.3, undocumented.3, cciss.4, console_codes.4, hpsa.4, initrd.4, intro.4, rtc.4, st.4, tty_ioctl.4, wavelan.4, acct.5, charmap.5, dir_colors.5, hosts.5, intro.5, termcap.5, utmp.5, intro.6, armscii-8.7, boot.7, bootparam.7, capabilities.7, cpuset.7, credentials.7, ddp.7, epoll.7, glob.7, intro.7, ip.7, ipv6.7, iso_8859-1.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-16.7, iso_8859-2.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-8.7, iso_8859-9.7, koi8-r.7, koi8-u.7, man-pages.7, man.7, math_error.7, netlink.7, numa.7, packet.7, path_resolution.7, pipe.7, pthreads.7, raw.7, rtnetlink.7, signal.7, socket.7, spufs.7, svipc.7, tcp.7, time.7, udp.7, udplite.7, unicode.7, unix.7, uri.7, utf-8.7, x25.7, intro.8: Global fix: use consistent capitalization in .SS headings
Capitalization in .SS sections across pages (and sometimes even
within a single page) is wildly inconsistent. Make it consistent.
Capitalize first word in heading, but otherwise use lower case,
except where English usage (e.g., proper nouns) or programming
language requirements (e.g., identifier names) dictate otherwise.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-02-24 14:08:38 +00:00
|
|
|
.SS Address format
|
2008-08-08 16:41:48 +00:00
|
|
|
An IP socket address is defined as a combination of an IP interface
|
|
|
|
address and a 16-bit port number.
|
|
|
|
The basic IP protocol does not supply port numbers, they
|
|
|
|
are implemented by higher level protocols like
|
|
|
|
.BR udp (7)
|
|
|
|
and
|
|
|
|
.BR tcp (7).
|
|
|
|
On raw sockets
|
|
|
|
.I sin_port
|
|
|
|
is set to the IP protocol.
|
|
|
|
.PP
|
|
|
|
.in +4n
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EX
|
2008-08-08 16:41:48 +00:00
|
|
|
struct sockaddr_in {
|
|
|
|
sa_family_t sin_family; /* address family: AF_INET */
|
2009-02-28 09:53:23 +00:00
|
|
|
in_port_t sin_port; /* port in network byte order */
|
2008-08-08 16:41:48 +00:00
|
|
|
struct in_addr sin_addr; /* internet address */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Internet address. */
|
|
|
|
struct in_addr {
|
|
|
|
uint32_t s_addr; /* address in network byte order */
|
|
|
|
};
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EE
|
2008-08-08 16:41:48 +00:00
|
|
|
.in
|
|
|
|
.PP
|
|
|
|
.I sin_family
|
|
|
|
is always set to
|
|
|
|
.BR AF_INET .
|
|
|
|
This is required; in Linux 2.2 most networking functions return
|
|
|
|
.B EINVAL
|
|
|
|
when this setting is missing.
|
|
|
|
.I sin_port
|
|
|
|
contains the port in network byte order.
|
|
|
|
The port numbers below 1024 are called
|
2008-12-04 11:37:25 +00:00
|
|
|
.IR "privileged ports"
|
|
|
|
(or sometimes:
|
|
|
|
.IR "reserved ports" ).
|
2016-09-12 17:51:48 +00:00
|
|
|
Only a privileged process
|
|
|
|
(on Linux: a process that has the
|
2008-08-08 16:41:48 +00:00
|
|
|
.B CAP_NET_BIND_SERVICE
|
2016-09-12 17:51:48 +00:00
|
|
|
capability in the user namespace governing its network namespace) may
|
2008-08-08 16:41:48 +00:00
|
|
|
.BR bind (2)
|
|
|
|
to these sockets.
|
|
|
|
Note that the raw IPv4 protocol as such has no concept of a
|
intro.1, _syscall.2, access.2, arch_prctl.2, cacheflush.2, chown.2, clock_getres.2, clone.2, create_module.2, fcntl.2, flock.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getpriority.2, getrlimit.2, getrusage.2, ioprio_set.2, kexec_load.2, madvise.2, mbind.2, migrate_pages.2, mknod.2, mmap.2, mount.2, move_pages.2, mprotect.2, open.2, pause.2, pciconfig_read.2, perf_event_open.2, prctl.2, ptrace.2, query_module.2, read.2, reboot.2, recv.2, s390_runtime_instr.2, sched_setscheduler.2, select_tut.2, send.2, set_mempolicy.2, setfsgid.2, setfsuid.2, sigaction.2, spu_create.2, spu_run.2, stime.2, swapon.2, syslog.2, timer_create.2, timer_getoverrun.2, times.2, tkill.2, umount.2, unimplemented.2, ustat.2, vm86.2, wait.2, abs.3, aio_read.3, aio_write.3, bsd_signal.3, catgets.3, clearenv.3, cmsg.3, dbopen.3, dirfd.3, dlopen.3, exec.3, fenv.3, ferror.3, fmemopen.3, fnmatch.3, fopen.3, futimes.3, getaddrinfo.3, getifaddrs.3, getipnodebyname.3, hsearch.3, if_nameindex.3, inet_pton.3, mblen.3, mbrlen.3, mbsrtowcs.3, mbtowc.3, mcheck.3, memfrob.3, mq_notify.3, netlink.3, posix_memalign.3, printf.3, pthread_attr_setscope.3, pthread_cleanup_push.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, raise.3, resolver.3, rpc.3, rtime.3, rtnetlink.3, scanf.3, setbuf.3, setnetgrent.3, shm_open.3, sigpause.3, sigset.3, sigwait.3, sockatmark.3, strcasecmp.3, strcmp.3, strdup.3, strftime.3, strptime.3, strsignal.3, strverscmp.3, sysv_signal.3, termios.3, wcrtomb.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wctomb.3, wprintf.3, console_codes.4, cpuid.4, msr.4, rtc.4, sk98lin.4, st.4, tty.4, charmap.5, core.5, elf.5, hosts.equiv.5, proc.5, resolv.conf.5, services.5, slabinfo.5, arp.7, bootparam.7, capabilities.7, charsets.7, cpuset.7, ddp.7, epoll.7, feature_test_macros.7, futex.7, hier.7, icmp.7, inotify.7, ip.7, ipv6.7, man-pages.7, mdoc.7, mdoc.samples.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, posixoptions.7, pthreads.7, raw.7, rtld-audit.7, rtnetlink.7, sem_overview.7, sigevent.7, socket.7, spufs.7, tcp.7, udp.7, unicode.7, uri.7, utf-8.7, intro.8, ldconfig.8, sync.8: Global fix: fix placement of word "only"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-31 08:53:00 +00:00
|
|
|
port, they are implemented only by higher protocols like
|
2008-08-08 16:41:48 +00:00
|
|
|
.BR tcp (7)
|
|
|
|
and
|
|
|
|
.BR udp (7).
|
|
|
|
.PP
|
|
|
|
.I sin_addr
|
|
|
|
is the IP host address.
|
|
|
|
The
|
|
|
|
.I s_addr
|
|
|
|
member of
|
|
|
|
.I struct in_addr
|
|
|
|
contains the host interface address in network byte order.
|
|
|
|
.I in_addr
|
2010-10-24 06:14:37 +00:00
|
|
|
should be assigned one of the
|
|
|
|
.BR INADDR_*
|
2017-12-14 21:18:20 +00:00
|
|
|
values
|
|
|
|
(e.g.,
|
2017-12-18 16:39:02 +00:00
|
|
|
.BR INADDR_LOOPBACK )
|
2017-12-14 21:18:20 +00:00
|
|
|
using
|
|
|
|
.BR htonl (3)
|
2008-08-08 16:41:48 +00:00
|
|
|
or set using the
|
|
|
|
.BR inet_aton (3),
|
|
|
|
.BR inet_addr (3),
|
|
|
|
.BR inet_makeaddr (3)
|
|
|
|
library functions or directly with the name resolver (see
|
|
|
|
.BR gethostbyname (3)).
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.PP
|
2016-08-23 06:20:23 +00:00
|
|
|
IPv4 addresses are divided into unicast, broadcast,
|
2008-08-08 16:41:48 +00:00
|
|
|
and multicast addresses.
|
|
|
|
Unicast addresses specify a single interface of a host,
|
2016-08-23 06:20:23 +00:00
|
|
|
broadcast addresses specify all hosts on a network, and multicast
|
2008-08-08 16:41:48 +00:00
|
|
|
addresses address all hosts in a multicast group.
|
intro.1, _syscall.2, access.2, arch_prctl.2, cacheflush.2, chown.2, clock_getres.2, clone.2, create_module.2, fcntl.2, flock.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getpriority.2, getrlimit.2, getrusage.2, ioprio_set.2, kexec_load.2, madvise.2, mbind.2, migrate_pages.2, mknod.2, mmap.2, mount.2, move_pages.2, mprotect.2, open.2, pause.2, pciconfig_read.2, perf_event_open.2, prctl.2, ptrace.2, query_module.2, read.2, reboot.2, recv.2, s390_runtime_instr.2, sched_setscheduler.2, select_tut.2, send.2, set_mempolicy.2, setfsgid.2, setfsuid.2, sigaction.2, spu_create.2, spu_run.2, stime.2, swapon.2, syslog.2, timer_create.2, timer_getoverrun.2, times.2, tkill.2, umount.2, unimplemented.2, ustat.2, vm86.2, wait.2, abs.3, aio_read.3, aio_write.3, bsd_signal.3, catgets.3, clearenv.3, cmsg.3, dbopen.3, dirfd.3, dlopen.3, exec.3, fenv.3, ferror.3, fmemopen.3, fnmatch.3, fopen.3, futimes.3, getaddrinfo.3, getifaddrs.3, getipnodebyname.3, hsearch.3, if_nameindex.3, inet_pton.3, mblen.3, mbrlen.3, mbsrtowcs.3, mbtowc.3, mcheck.3, memfrob.3, mq_notify.3, netlink.3, posix_memalign.3, printf.3, pthread_attr_setscope.3, pthread_cleanup_push.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, raise.3, resolver.3, rpc.3, rtime.3, rtnetlink.3, scanf.3, setbuf.3, setnetgrent.3, shm_open.3, sigpause.3, sigset.3, sigwait.3, sockatmark.3, strcasecmp.3, strcmp.3, strdup.3, strftime.3, strptime.3, strsignal.3, strverscmp.3, sysv_signal.3, termios.3, wcrtomb.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wctomb.3, wprintf.3, console_codes.4, cpuid.4, msr.4, rtc.4, sk98lin.4, st.4, tty.4, charmap.5, core.5, elf.5, hosts.equiv.5, proc.5, resolv.conf.5, services.5, slabinfo.5, arp.7, bootparam.7, capabilities.7, charsets.7, cpuset.7, ddp.7, epoll.7, feature_test_macros.7, futex.7, hier.7, icmp.7, inotify.7, ip.7, ipv6.7, man-pages.7, mdoc.7, mdoc.samples.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, posixoptions.7, pthreads.7, raw.7, rtld-audit.7, rtnetlink.7, sem_overview.7, sigevent.7, socket.7, spufs.7, tcp.7, udp.7, unicode.7, uri.7, utf-8.7, intro.8, ldconfig.8, sync.8: Global fix: fix placement of word "only"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-31 08:53:00 +00:00
|
|
|
Datagrams to broadcast addresses can be sent or received only when the
|
2008-08-08 16:41:48 +00:00
|
|
|
.B SO_BROADCAST
|
|
|
|
socket flag is set.
|
intro.1, _syscall.2, access.2, arch_prctl.2, cacheflush.2, chown.2, clock_getres.2, clone.2, create_module.2, fcntl.2, flock.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getpriority.2, getrlimit.2, getrusage.2, ioprio_set.2, kexec_load.2, madvise.2, mbind.2, migrate_pages.2, mknod.2, mmap.2, mount.2, move_pages.2, mprotect.2, open.2, pause.2, pciconfig_read.2, perf_event_open.2, prctl.2, ptrace.2, query_module.2, read.2, reboot.2, recv.2, s390_runtime_instr.2, sched_setscheduler.2, select_tut.2, send.2, set_mempolicy.2, setfsgid.2, setfsuid.2, sigaction.2, spu_create.2, spu_run.2, stime.2, swapon.2, syslog.2, timer_create.2, timer_getoverrun.2, times.2, tkill.2, umount.2, unimplemented.2, ustat.2, vm86.2, wait.2, abs.3, aio_read.3, aio_write.3, bsd_signal.3, catgets.3, clearenv.3, cmsg.3, dbopen.3, dirfd.3, dlopen.3, exec.3, fenv.3, ferror.3, fmemopen.3, fnmatch.3, fopen.3, futimes.3, getaddrinfo.3, getifaddrs.3, getipnodebyname.3, hsearch.3, if_nameindex.3, inet_pton.3, mblen.3, mbrlen.3, mbsrtowcs.3, mbtowc.3, mcheck.3, memfrob.3, mq_notify.3, netlink.3, posix_memalign.3, printf.3, pthread_attr_setscope.3, pthread_cleanup_push.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, raise.3, resolver.3, rpc.3, rtime.3, rtnetlink.3, scanf.3, setbuf.3, setnetgrent.3, shm_open.3, sigpause.3, sigset.3, sigwait.3, sockatmark.3, strcasecmp.3, strcmp.3, strdup.3, strftime.3, strptime.3, strsignal.3, strverscmp.3, sysv_signal.3, termios.3, wcrtomb.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wctomb.3, wprintf.3, console_codes.4, cpuid.4, msr.4, rtc.4, sk98lin.4, st.4, tty.4, charmap.5, core.5, elf.5, hosts.equiv.5, proc.5, resolv.conf.5, services.5, slabinfo.5, arp.7, bootparam.7, capabilities.7, charsets.7, cpuset.7, ddp.7, epoll.7, feature_test_macros.7, futex.7, hier.7, icmp.7, inotify.7, ip.7, ipv6.7, man-pages.7, mdoc.7, mdoc.samples.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, posixoptions.7, pthreads.7, raw.7, rtld-audit.7, rtnetlink.7, sem_overview.7, sigevent.7, socket.7, spufs.7, tcp.7, udp.7, unicode.7, uri.7, utf-8.7, intro.8, ldconfig.8, sync.8: Global fix: fix placement of word "only"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-31 08:53:00 +00:00
|
|
|
In the current implementation, connection-oriented sockets are allowed
|
|
|
|
to use only unicast addresses.
|
2008-08-08 16:41:48 +00:00
|
|
|
.\" Leave a loophole for XTP @)
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.PP
|
2008-08-08 16:41:48 +00:00
|
|
|
Note that the address and the port are always stored in
|
|
|
|
network byte order.
|
|
|
|
In particular, this means that you need to call
|
|
|
|
.BR htons (3)
|
|
|
|
on the number that is assigned to a port.
|
|
|
|
All address/port manipulation
|
|
|
|
functions in the standard library work in network byte order.
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.PP
|
2008-08-08 16:41:48 +00:00
|
|
|
There are several special addresses:
|
|
|
|
.B INADDR_LOOPBACK
|
|
|
|
(127.0.0.1)
|
|
|
|
always refers to the local host via the loopback device;
|
|
|
|
.B INADDR_ANY
|
|
|
|
(0.0.0.0)
|
|
|
|
means any address for binding;
|
|
|
|
.B INADDR_BROADCAST
|
|
|
|
(255.255.255.255)
|
|
|
|
means any host and has the same effect on bind as
|
|
|
|
.B INADDR_ANY
|
|
|
|
for historical reasons.
|
intro.1, time.1, _syscall.2, accept.2, brk.2, capget.2, faccessat.2, futimesat.2, gethostname.2, intro.2, ioprio_set.2, kill.2, madvise.2, mlock.2, mount.2, msgget.2, perf_event_open.2, poll.2, readv.2, sched_rr_get_interval.2, sched_setscheduler.2, select.2, select_tut.2, shmget.2, stat.2, timer_create.2, ustat.2, vfork.2, wait.2, alloca.3, atexit.3, catopen.3, crypt.3, dbopen.3, fenv.3, fopen.3, getaddrinfo_a.3, gethostbyname.3, getutent.3, intro.3, login.3, mallopt.3, queue.3, regex.3, sigpause.3, sigsetops.3, stdio.3, strftime.3, strptime.3, sysconf.3, ttyslot.3, undocumented.3, cciss.4, console_codes.4, hpsa.4, initrd.4, intro.4, rtc.4, st.4, tty_ioctl.4, wavelan.4, acct.5, charmap.5, dir_colors.5, hosts.5, intro.5, termcap.5, utmp.5, intro.6, armscii-8.7, boot.7, bootparam.7, capabilities.7, cpuset.7, credentials.7, ddp.7, epoll.7, glob.7, intro.7, ip.7, ipv6.7, iso_8859-1.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-16.7, iso_8859-2.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-8.7, iso_8859-9.7, koi8-r.7, koi8-u.7, man-pages.7, man.7, math_error.7, netlink.7, numa.7, packet.7, path_resolution.7, pipe.7, pthreads.7, raw.7, rtnetlink.7, signal.7, socket.7, spufs.7, svipc.7, tcp.7, time.7, udp.7, udplite.7, unicode.7, unix.7, uri.7, utf-8.7, x25.7, intro.8: Global fix: use consistent capitalization in .SS headings
Capitalization in .SS sections across pages (and sometimes even
within a single page) is wildly inconsistent. Make it consistent.
Capitalize first word in heading, but otherwise use lower case,
except where English usage (e.g., proper nouns) or programming
language requirements (e.g., identifier names) dictate otherwise.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-02-24 14:08:38 +00:00
|
|
|
.SS Socket options
|
2008-08-08 16:41:48 +00:00
|
|
|
IP supports some protocol-specific socket options that can be set with
|
|
|
|
.BR setsockopt (2)
|
|
|
|
and read with
|
|
|
|
.BR getsockopt (2).
|
|
|
|
The socket option level for IP is
|
|
|
|
.BR IPPROTO_IP .
|
|
|
|
.\" or SOL_IP on Linux
|
|
|
|
A boolean integer flag is zero when it is false, otherwise true.
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.PP
|
2015-05-06 13:31:45 +00:00
|
|
|
When an invalid socket option is specified,
|
|
|
|
.BR getsockopt (2)
|
|
|
|
and
|
|
|
|
.BR setsockopt (2)
|
|
|
|
fail with the error
|
|
|
|
.BR ENOPROTOOPT .
|
2008-08-08 16:41:48 +00:00
|
|
|
.TP
|
2009-09-27 07:26:41 +00:00
|
|
|
.BR IP_ADD_MEMBERSHIP " (since Linux 1.2)"
|
2008-11-22 03:15:38 +00:00
|
|
|
Join a multicast group.
|
|
|
|
Argument is an
|
|
|
|
.I ip_mreqn
|
|
|
|
structure.
|
dir_colors.5, feature_test_macros.7, glob.7, ip.7, ipv6.7, man-pages.7, man.7, netdevice.7, rtnetlink.7, socket.7, svipc.7, tcp.7, units.7, user_namespaces.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:55:49 +00:00
|
|
|
.PP
|
2008-11-22 03:15:38 +00:00
|
|
|
.in +4n
|
dir_colors.5, feature_test_macros.7, glob.7, ip.7, ipv6.7, man-pages.7, man.7, netdevice.7, rtnetlink.7, socket.7, svipc.7, tcp.7, units.7, user_namespaces.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:55:49 +00:00
|
|
|
.EX
|
2008-11-22 03:15:38 +00:00
|
|
|
struct ip_mreqn {
|
|
|
|
struct in_addr imr_multiaddr; /* IP multicast group
|
|
|
|
address */
|
|
|
|
struct in_addr imr_address; /* IP address of local
|
|
|
|
interface */
|
|
|
|
int imr_ifindex; /* interface index */
|
|
|
|
};
|
dir_colors.5, feature_test_macros.7, glob.7, ip.7, ipv6.7, man-pages.7, man.7, netdevice.7, rtnetlink.7, socket.7, svipc.7, tcp.7, units.7, user_namespaces.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:55:49 +00:00
|
|
|
.EE
|
2008-11-22 03:15:38 +00:00
|
|
|
.in
|
dir_colors.5, feature_test_macros.7, glob.7, ip.7, ipv6.7, man-pages.7, man.7, netdevice.7, rtnetlink.7, socket.7, svipc.7, tcp.7, units.7, user_namespaces.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:55:49 +00:00
|
|
|
.PP
|
2008-11-22 03:15:38 +00:00
|
|
|
.I imr_multiaddr
|
|
|
|
contains the address of the multicast group the application
|
|
|
|
wants to join or leave.
|
|
|
|
It must be a valid multicast address
|
|
|
|
.\" (i.e., within the 224.0.0.0-239.255.255.255 range)
|
|
|
|
(or
|
|
|
|
.BR setsockopt (2)
|
|
|
|
fails with the error
|
|
|
|
.BR EINVAL ).
|
|
|
|
.I imr_address
|
|
|
|
is the address of the local interface with which the system
|
|
|
|
should join the multicast group; if it is equal to
|
2014-03-26 13:01:44 +00:00
|
|
|
.BR INADDR_ANY ,
|
2008-11-22 03:15:38 +00:00
|
|
|
an appropriate interface is chosen by the system.
|
|
|
|
.I imr_ifindex
|
|
|
|
is the interface index of the interface that should join/leave the
|
|
|
|
.I imr_multiaddr
|
|
|
|
group, or 0 to indicate any interface.
|
|
|
|
.IP
|
2008-11-24 15:43:38 +00:00
|
|
|
The
|
|
|
|
.I ip_mreqn
|
2010-10-13 03:46:00 +00:00
|
|
|
structure is available only since Linux 2.2.
|
2008-11-22 03:15:38 +00:00
|
|
|
For compatibility, the old
|
|
|
|
.I ip_mreq
|
2010-10-13 03:46:00 +00:00
|
|
|
structure (present since Linux 1.2) is still supported;
|
|
|
|
it differs from
|
2008-11-22 03:15:38 +00:00
|
|
|
.I ip_mreqn
|
|
|
|
only by not including the
|
|
|
|
.I imr_ifindex
|
|
|
|
field.
|
2015-05-06 09:56:09 +00:00
|
|
|
(The kernel determines which structure is being passed based
|
|
|
|
on the size passed in
|
|
|
|
.IR optlen .)
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.IP
|
2015-05-06 09:52:59 +00:00
|
|
|
.B IP_ADD_MEMBERSHIP
|
|
|
|
is valid only for
|
2008-11-22 03:15:38 +00:00
|
|
|
.BR setsockopt (2).
|
|
|
|
.\"
|
|
|
|
.TP
|
2013-02-10 02:44:05 +00:00
|
|
|
.BR IP_ADD_SOURCE_MEMBERSHIP " (since Linux 2.4.22 / 2.5.68)"
|
2013-02-10 02:33:27 +00:00
|
|
|
Join a multicast group and allow receiving data only
|
|
|
|
from a specified source.
|
|
|
|
Argument is an
|
|
|
|
.I ip_mreq_source
|
|
|
|
structure.
|
capget.2, gettimeofday.2, nanosleep.2, process_vm_readv.2, readv.2, seccomp.2, semop.2, sigaction.2, sigwaitinfo.2, dbopen.3, dladdr.3, ether_aton.3, fenv.3, fgetgrent.3, fgetpwent.3, frexp.3, ftime.3, gamma.3, getaddrinfo.3, getaddrinfo_a.3, getgrent_r.3, getgrnam.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnetent.3, getprotoent.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getservent.3, getspnam.3, getutent.3, glob.3, hsearch.3, if_nameindex.3, inet.3, mq_receive.3, putgrent.3, putpwent.3, rand.3, sigqueue.3, strfromd.3, strptime.3, strtol.3, termios.3, timeradd.3, lp.4, tty.4, ip.7, ipv6.7, netdevice.7, raw.7, rtnetlink.7, units.7, zic.8: ffix: replace .sp by .PP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 23:00:48 +00:00
|
|
|
.PP
|
2013-02-10 02:33:27 +00:00
|
|
|
.in +4n
|
dir_colors.5, feature_test_macros.7, glob.7, ip.7, ipv6.7, man-pages.7, man.7, netdevice.7, rtnetlink.7, socket.7, svipc.7, tcp.7, units.7, user_namespaces.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:55:49 +00:00
|
|
|
.EX
|
2013-02-10 02:33:27 +00:00
|
|
|
struct ip_mreq_source {
|
|
|
|
struct in_addr imr_multiaddr; /* IP multicast group
|
|
|
|
address */
|
|
|
|
struct in_addr imr_interface; /* IP address of local
|
|
|
|
interface */
|
|
|
|
struct in_addr imr_sourceaddr; /* IP address of
|
|
|
|
multicast source */
|
|
|
|
};
|
dir_colors.5, feature_test_macros.7, glob.7, ip.7, ipv6.7, man-pages.7, man.7, netdevice.7, rtnetlink.7, socket.7, svipc.7, tcp.7, units.7, user_namespaces.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:55:49 +00:00
|
|
|
.EE
|
2013-02-10 02:33:27 +00:00
|
|
|
.in
|
capget.2, gettimeofday.2, nanosleep.2, process_vm_readv.2, readv.2, seccomp.2, semop.2, sigaction.2, sigwaitinfo.2, dbopen.3, dladdr.3, ether_aton.3, fenv.3, fgetgrent.3, fgetpwent.3, frexp.3, ftime.3, gamma.3, getaddrinfo.3, getaddrinfo_a.3, getgrent_r.3, getgrnam.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnetent.3, getprotoent.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getservent.3, getspnam.3, getutent.3, glob.3, hsearch.3, if_nameindex.3, inet.3, mq_receive.3, putgrent.3, putpwent.3, rand.3, sigqueue.3, strfromd.3, strptime.3, strtol.3, termios.3, timeradd.3, lp.4, tty.4, ip.7, ipv6.7, netdevice.7, raw.7, rtnetlink.7, units.7, zic.8: ffix: replace .sp by .PP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 23:00:48 +00:00
|
|
|
.PP
|
2013-02-10 02:44:05 +00:00
|
|
|
The
|
2013-02-10 02:33:27 +00:00
|
|
|
.I ip_mreq_source
|
|
|
|
structure is similar to
|
|
|
|
.I ip_mreqn
|
2013-02-10 02:44:05 +00:00
|
|
|
described under
|
2020-05-14 18:23:48 +00:00
|
|
|
.BR IP_ADD_MEMBERSHIP .
|
2013-02-10 02:44:05 +00:00
|
|
|
The
|
2013-02-10 02:33:27 +00:00
|
|
|
.I imr_multiaddr
|
2013-02-10 02:44:05 +00:00
|
|
|
field contains the address of the multicast group the application
|
2013-02-10 02:33:27 +00:00
|
|
|
wants to join or leave.
|
2013-02-10 02:44:05 +00:00
|
|
|
The
|
2013-02-10 02:33:27 +00:00
|
|
|
.I imr_interface
|
2013-02-10 02:44:05 +00:00
|
|
|
field is the address of the local interface with which
|
2013-02-10 02:33:27 +00:00
|
|
|
the system should join the multicast group.
|
2013-02-10 02:44:05 +00:00
|
|
|
Finally, the
|
2013-02-10 02:33:27 +00:00
|
|
|
.I imr_sourceaddr
|
2013-02-10 02:44:05 +00:00
|
|
|
field contains the address of the source the
|
2013-02-10 02:33:27 +00:00
|
|
|
application wants to receive data from.
|
|
|
|
.IP
|
|
|
|
This option can be used multiple times to allow
|
|
|
|
receiving data from more than one source.
|
|
|
|
.TP
|
2016-02-03 11:14:36 +00:00
|
|
|
.BR IP_BIND_ADDRESS_NO_PORT " (since Linux 4.2)"
|
|
|
|
.\" commit 90c337da1524863838658078ec34241f45d8394d
|
|
|
|
Inform the kernel to not reserve an ephemeral port when using
|
|
|
|
.BR bind (2)
|
|
|
|
with a port number of 0.
|
|
|
|
The port will later be automatically chosen at
|
|
|
|
.BR connect (2)
|
|
|
|
time,
|
|
|
|
in a way that allows sharing a source port as long as the 4-tuple is unique.
|
2016-02-01 23:35:22 +00:00
|
|
|
.TP
|
2013-02-10 02:44:05 +00:00
|
|
|
.BR IP_BLOCK_SOURCE " (since Linux 2.4.22 / 2.5.68)"
|
2013-02-14 00:24:47 +00:00
|
|
|
Stop receiving multicast data from a specific source in a given group.
|
|
|
|
This is valid only after the application has subscribed
|
2013-02-10 02:33:27 +00:00
|
|
|
to the multicast group using either
|
|
|
|
.BR IP_ADD_MEMBERSHIP
|
|
|
|
or
|
|
|
|
.BR IP_ADD_SOURCE_MEMBERSHIP .
|
|
|
|
.IP
|
|
|
|
Argument is an
|
|
|
|
.I ip_mreq_source
|
2013-02-10 02:44:05 +00:00
|
|
|
structure as described under
|
2013-02-10 02:33:27 +00:00
|
|
|
.BR IP_ADD_SOURCE_MEMBERSHIP .
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_DROP_MEMBERSHIP " (since Linux 1.2)"
|
2008-11-22 03:15:38 +00:00
|
|
|
Leave a multicast group.
|
|
|
|
Argument is an
|
|
|
|
.I ip_mreqn
|
|
|
|
or
|
|
|
|
.I ip_mreq
|
|
|
|
structure similar to
|
|
|
|
.BR IP_ADD_MEMBERSHIP .
|
|
|
|
.TP
|
2013-02-10 02:44:05 +00:00
|
|
|
.BR IP_DROP_SOURCE_MEMBERSHIP " (since Linux 2.4.22 / 2.5.68)"
|
|
|
|
Leave a source-specific group\(emthat is, stop receiving data from
|
|
|
|
a given multicast group that come from a given source.
|
2013-02-10 02:33:27 +00:00
|
|
|
If the application has subscribed to multiple sources within
|
2013-02-14 00:24:47 +00:00
|
|
|
the same group, data from the remaining sources will still be delivered.
|
|
|
|
To stop receiving data from all sources at once, use
|
2016-03-21 20:28:44 +00:00
|
|
|
.BR IP_DROP_MEMBERSHIP .
|
2013-02-10 02:33:27 +00:00
|
|
|
.IP
|
|
|
|
Argument is an
|
|
|
|
.I ip_mreq_source
|
2013-02-10 02:44:05 +00:00
|
|
|
structure as described under
|
2013-02-10 02:33:27 +00:00
|
|
|
.BR IP_ADD_SOURCE_MEMBERSHIP .
|
|
|
|
.TP
|
2010-10-24 06:16:40 +00:00
|
|
|
.BR IP_FREEBIND " (since Linux 2.4)"
|
|
|
|
.\" Precisely: 2.4.0-test10
|
|
|
|
If enabled, this boolean option allows binding to an IP address
|
|
|
|
that is nonlocal or does not (yet) exist.
|
|
|
|
This permits listening on a socket,
|
|
|
|
without requiring the underlying network interface or the
|
|
|
|
specified dynamic IP address to be up at the time that
|
|
|
|
the application is trying to bind to it.
|
|
|
|
This option is the per-socket equivalent of the
|
|
|
|
.IR ip_nonlocal_bind
|
|
|
|
.I /proc
|
|
|
|
interface described below.
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_HDRINCL " (since Linux 2.0)"
|
2008-11-22 03:15:38 +00:00
|
|
|
If enabled,
|
|
|
|
the user supplies an IP header in front of the user data.
|
2015-05-06 09:52:59 +00:00
|
|
|
Valid only for
|
2008-11-22 03:15:38 +00:00
|
|
|
.B SOCK_RAW
|
2015-05-06 09:52:59 +00:00
|
|
|
sockets; see
|
2008-11-22 03:15:38 +00:00
|
|
|
.BR raw (7)
|
|
|
|
for more information.
|
2015-03-27 13:27:26 +00:00
|
|
|
When this flag is enabled, the values set by
|
2008-11-22 03:15:38 +00:00
|
|
|
.BR IP_OPTIONS ,
|
2015-05-06 09:52:59 +00:00
|
|
|
.BR IP_TTL ,
|
2008-11-22 03:15:38 +00:00
|
|
|
and
|
|
|
|
.B IP_TOS
|
|
|
|
are ignored.
|
|
|
|
.TP
|
2013-02-10 02:44:05 +00:00
|
|
|
.BR IP_MSFILTER " (since Linux 2.4.22 / 2.5.68)"
|
2013-02-10 02:33:27 +00:00
|
|
|
This option provides access to the advanced full-state filtering API.
|
|
|
|
Argument is an
|
|
|
|
.I ip_msfilter
|
|
|
|
structure.
|
capget.2, gettimeofday.2, nanosleep.2, process_vm_readv.2, readv.2, seccomp.2, semop.2, sigaction.2, sigwaitinfo.2, dbopen.3, dladdr.3, ether_aton.3, fenv.3, fgetgrent.3, fgetpwent.3, frexp.3, ftime.3, gamma.3, getaddrinfo.3, getaddrinfo_a.3, getgrent_r.3, getgrnam.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnetent.3, getprotoent.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getservent.3, getspnam.3, getutent.3, glob.3, hsearch.3, if_nameindex.3, inet.3, mq_receive.3, putgrent.3, putpwent.3, rand.3, sigqueue.3, strfromd.3, strptime.3, strtol.3, termios.3, timeradd.3, lp.4, tty.4, ip.7, ipv6.7, netdevice.7, raw.7, rtnetlink.7, units.7, zic.8: ffix: replace .sp by .PP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 23:00:48 +00:00
|
|
|
.PP
|
2013-02-10 02:33:27 +00:00
|
|
|
.in +4n
|
dir_colors.5, feature_test_macros.7, glob.7, ip.7, ipv6.7, man-pages.7, man.7, netdevice.7, rtnetlink.7, socket.7, svipc.7, tcp.7, units.7, user_namespaces.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:55:49 +00:00
|
|
|
.EX
|
2013-02-10 02:33:27 +00:00
|
|
|
struct ip_msfilter {
|
|
|
|
struct in_addr imsf_multiaddr; /* IP multicast group
|
|
|
|
address */
|
|
|
|
struct in_addr imsf_interface; /* IP address of local
|
|
|
|
interface */
|
|
|
|
uint32_t imsf_fmode; /* Filter-mode */
|
|
|
|
|
|
|
|
uint32_t imsf_numsrc; /* Number of sources in
|
|
|
|
the following array */
|
|
|
|
struct in_addr imsf_slist[1]; /* Array of source
|
|
|
|
addresses */
|
|
|
|
};
|
dir_colors.5, feature_test_macros.7, glob.7, ip.7, ipv6.7, man-pages.7, man.7, netdevice.7, rtnetlink.7, socket.7, svipc.7, tcp.7, units.7, user_namespaces.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:55:49 +00:00
|
|
|
.EE
|
2013-02-10 02:33:27 +00:00
|
|
|
.in
|
capget.2, gettimeofday.2, nanosleep.2, process_vm_readv.2, readv.2, seccomp.2, semop.2, sigaction.2, sigwaitinfo.2, dbopen.3, dladdr.3, ether_aton.3, fenv.3, fgetgrent.3, fgetpwent.3, frexp.3, ftime.3, gamma.3, getaddrinfo.3, getaddrinfo_a.3, getgrent_r.3, getgrnam.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnetent.3, getprotoent.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getservent.3, getspnam.3, getutent.3, glob.3, hsearch.3, if_nameindex.3, inet.3, mq_receive.3, putgrent.3, putpwent.3, rand.3, sigqueue.3, strfromd.3, strptime.3, strtol.3, termios.3, timeradd.3, lp.4, tty.4, ip.7, ipv6.7, netdevice.7, raw.7, rtnetlink.7, units.7, zic.8: ffix: replace .sp by .PP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 23:00:48 +00:00
|
|
|
.PP
|
2013-02-10 02:33:27 +00:00
|
|
|
There are two macros,
|
|
|
|
.BR MCAST_INCLUDE
|
|
|
|
and
|
|
|
|
.BR MCAST_EXCLUDE ,
|
|
|
|
which can be used to specify the filtering mode.
|
2013-02-10 02:44:05 +00:00
|
|
|
Additionally, the
|
2013-02-10 02:33:27 +00:00
|
|
|
.BR IP_MSFILTER_SIZE (n)
|
|
|
|
macro exists to determine how much memory is needed to store
|
|
|
|
.I ip_msfilter
|
|
|
|
structure with
|
|
|
|
.I n
|
|
|
|
sources in the source list.
|
|
|
|
.IP
|
|
|
|
For the full description of multicast source filtering
|
|
|
|
refer to RFC 3376.
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_MTU " (since Linux 2.2)"
|
|
|
|
.\" Precisely: 2.1.124
|
2008-11-22 03:15:38 +00:00
|
|
|
Retrieve the current known path MTU of the current socket.
|
|
|
|
Returns an integer.
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.IP
|
2015-05-06 09:52:59 +00:00
|
|
|
.B IP_MTU
|
|
|
|
is valid only for
|
|
|
|
.BR getsockopt (2)
|
|
|
|
and can be employed only when the socket has been connected.
|
2008-11-22 03:15:38 +00:00
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_MTU_DISCOVER " (since Linux 2.2)"
|
|
|
|
.\" Precisely: 2.1.124
|
2009-09-27 07:26:41 +00:00
|
|
|
Set or receive the Path MTU Discovery setting for a socket.
|
2008-11-22 03:15:38 +00:00
|
|
|
When enabled, Linux will perform Path MTU Discovery
|
2011-09-22 04:08:30 +00:00
|
|
|
as defined in RFC\ 1191 on
|
2008-11-22 03:15:38 +00:00
|
|
|
.B SOCK_STREAM
|
2011-09-22 04:08:30 +00:00
|
|
|
sockets.
|
2008-11-22 03:15:38 +00:00
|
|
|
For
|
|
|
|
.RB non- SOCK_STREAM
|
2011-09-22 04:08:30 +00:00
|
|
|
sockets,
|
|
|
|
.B IP_PMTUDISC_DO
|
|
|
|
forces the don't-fragment flag to be set on all outgoing packets.
|
|
|
|
It is the user's responsibility to packetize the data
|
|
|
|
in MTU-sized chunks and to do the retransmits if necessary.
|
|
|
|
The kernel will reject (with
|
|
|
|
.BR EMSGSIZE )
|
|
|
|
datagrams that are bigger than the known path MTU.
|
|
|
|
.B IP_PMTUDISC_WANT
|
|
|
|
will fragment a datagram if needed according to the path MTU,
|
|
|
|
or will set the don't-fragment flag otherwise.
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.IP
|
2011-09-22 04:08:30 +00:00
|
|
|
The system-wide default can be toggled between
|
|
|
|
.B IP_PMTUDISC_WANT
|
|
|
|
and
|
|
|
|
.B IP_PMTUDISC_DONT
|
|
|
|
by writing (respectively, zero and nonzero values) to the
|
|
|
|
.I /proc/sys/net/ipv4/ip_no_pmtu_disc
|
|
|
|
file.
|
2008-11-22 03:15:38 +00:00
|
|
|
.TS
|
|
|
|
tab(:);
|
|
|
|
c l
|
|
|
|
l l.
|
2011-09-23 05:25:34 +00:00
|
|
|
Path MTU discovery value:Meaning
|
2008-11-22 03:15:38 +00:00
|
|
|
IP_PMTUDISC_WANT:Use per-route settings.
|
|
|
|
IP_PMTUDISC_DONT:Never do Path MTU Discovery.
|
|
|
|
IP_PMTUDISC_DO:Always do Path MTU Discovery.
|
|
|
|
IP_PMTUDISC_PROBE:Set DF but ignore Path MTU.
|
|
|
|
.TE
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.sp 1
|
2008-11-22 03:15:38 +00:00
|
|
|
When PMTU discovery is enabled, the kernel automatically keeps track of
|
|
|
|
the path MTU per destination host.
|
|
|
|
When it is connected to a specific peer with
|
|
|
|
.BR connect (2),
|
|
|
|
the currently known path MTU can be retrieved conveniently using the
|
|
|
|
.B IP_MTU
|
2011-09-22 03:42:02 +00:00
|
|
|
socket option (e.g., after an
|
2008-11-22 03:15:38 +00:00
|
|
|
.B EMSGSIZE
|
|
|
|
error occurred).
|
2011-09-22 03:42:02 +00:00
|
|
|
The path MTU may change over time.
|
2008-11-22 03:15:38 +00:00
|
|
|
For connectionless sockets with many destinations,
|
|
|
|
the new MTU for a given destination can also be accessed using the
|
|
|
|
error queue (see
|
|
|
|
.BR IP_RECVERR ).
|
|
|
|
A new error will be queued for every incoming MTU update.
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.IP
|
2008-11-22 03:15:38 +00:00
|
|
|
While MTU discovery is in progress, initial packets from datagram sockets
|
|
|
|
may be dropped.
|
|
|
|
Applications using UDP should be aware of this and not
|
|
|
|
take it into account for their packet retransmit strategy.
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.IP
|
2008-11-22 03:15:38 +00:00
|
|
|
To bootstrap the path MTU discovery process on unconnected sockets, it
|
|
|
|
is possible to start with a big datagram size
|
2017-08-18 10:04:03 +00:00
|
|
|
(headers up to 64 kilobytes long) and let it shrink by updates of the path MTU.
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.IP
|
2008-11-22 03:15:38 +00:00
|
|
|
To get an initial estimate of the
|
|
|
|
path MTU, connect a datagram socket to the destination address using
|
|
|
|
.BR connect (2)
|
|
|
|
and retrieve the MTU by calling
|
|
|
|
.BR getsockopt (2)
|
|
|
|
with the
|
|
|
|
.B IP_MTU
|
|
|
|
option.
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.IP
|
2008-11-22 03:15:38 +00:00
|
|
|
It is possible to implement RFC 4821 MTU probing with
|
|
|
|
.B SOCK_DGRAM
|
|
|
|
or
|
|
|
|
.B SOCK_RAW
|
|
|
|
sockets by setting a value of
|
2008-11-24 15:37:19 +00:00
|
|
|
.BR IP_PMTUDISC_PROBE
|
|
|
|
(available since Linux 2.6.22).
|
2008-11-22 03:15:38 +00:00
|
|
|
This is also particularly useful for diagnostic tools such as
|
|
|
|
.BR tracepath (8)
|
|
|
|
that wish to deliberately send probe packets larger than
|
|
|
|
the observed Path MTU.
|
|
|
|
.TP
|
2013-04-16 03:43:06 +00:00
|
|
|
.BR IP_MULTICAST_ALL " (since Linux 2.6.31)"
|
|
|
|
This option can be used to modify the delivery policy of multicast messages
|
|
|
|
to sockets bound to the wildcard
|
|
|
|
.B INADDR_ANY
|
2013-04-16 03:45:55 +00:00
|
|
|
address.
|
|
|
|
The argument is a boolean integer (defaults to 1).
|
|
|
|
If set to 1,
|
2013-04-16 03:43:06 +00:00
|
|
|
the socket will receive messages from all the groups that have been joined
|
2013-04-16 03:45:55 +00:00
|
|
|
globally on the whole system.
|
|
|
|
Otherwise, it will deliver messages only from
|
2013-04-16 03:43:06 +00:00
|
|
|
the groups that have been explicitly joined (for example via the
|
|
|
|
.B IP_ADD_MEMBERSHIP
|
|
|
|
option) on this particular socket.
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_MULTICAST_IF " (since Linux 1.2)"
|
2008-11-22 03:15:38 +00:00
|
|
|
Set the local device for a multicast socket.
|
2015-05-06 10:34:33 +00:00
|
|
|
The argument for
|
|
|
|
.BR setsockopt (2)
|
|
|
|
is an
|
2008-11-22 03:15:38 +00:00
|
|
|
.I ip_mreqn
|
|
|
|
or
|
2013-05-17 22:58:52 +00:00
|
|
|
.\" net: IP_MULTICAST_IF setsockopt now recognizes struct mreq
|
|
|
|
.\" Commit: 3a084ddb4bf299a6e898a9a07c89f3917f0713f7
|
|
|
|
(since Linux 3.5)
|
2015-05-06 09:05:49 +00:00
|
|
|
.I ip_mreq
|
2008-11-22 03:15:38 +00:00
|
|
|
structure similar to
|
2015-05-06 10:34:33 +00:00
|
|
|
.BR IP_ADD_MEMBERSHIP ,
|
|
|
|
or an
|
|
|
|
.I in_addr
|
|
|
|
structure.
|
|
|
|
(The kernel determines which structure is being passed based
|
|
|
|
on the size passed in
|
|
|
|
.IR optlen .)
|
|
|
|
For
|
|
|
|
.BR getsockopt (2),
|
|
|
|
the argument is an
|
|
|
|
.I in_addr
|
|
|
|
structure.
|
2008-11-22 03:15:38 +00:00
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_MULTICAST_LOOP " (since Linux 1.2)"
|
2009-09-27 07:26:41 +00:00
|
|
|
Set or read a boolean integer argument that determines whether
|
2008-11-22 03:15:38 +00:00
|
|
|
sent multicast packets should be looped back to the local sockets.
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_MULTICAST_TTL " (since Linux 1.2)"
|
2008-11-22 03:15:38 +00:00
|
|
|
Set or read the time-to-live value of outgoing multicast packets for this
|
|
|
|
socket.
|
|
|
|
It is very important for multicast packets to set the smallest TTL possible.
|
|
|
|
The default is 1 which means that multicast packets don't leave the local
|
|
|
|
network unless the user program explicitly requests it.
|
|
|
|
Argument is an integer.
|
|
|
|
.TP
|
2010-09-11 05:19:10 +00:00
|
|
|
.BR IP_NODEFRAG " (since Linux 2.6.36)"
|
|
|
|
If enabled (argument is nonzero),
|
|
|
|
the reassembly of outgoing packets is disabled in the netfilter layer.
|
2015-05-06 09:52:59 +00:00
|
|
|
The argument is an integer.
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.IP
|
intro.1, _syscall.2, access.2, arch_prctl.2, cacheflush.2, chown.2, clock_getres.2, clone.2, create_module.2, fcntl.2, flock.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getpriority.2, getrlimit.2, getrusage.2, ioprio_set.2, kexec_load.2, madvise.2, mbind.2, migrate_pages.2, mknod.2, mmap.2, mount.2, move_pages.2, mprotect.2, open.2, pause.2, pciconfig_read.2, perf_event_open.2, prctl.2, ptrace.2, query_module.2, read.2, reboot.2, recv.2, s390_runtime_instr.2, sched_setscheduler.2, select_tut.2, send.2, set_mempolicy.2, setfsgid.2, setfsuid.2, sigaction.2, spu_create.2, spu_run.2, stime.2, swapon.2, syslog.2, timer_create.2, timer_getoverrun.2, times.2, tkill.2, umount.2, unimplemented.2, ustat.2, vm86.2, wait.2, abs.3, aio_read.3, aio_write.3, bsd_signal.3, catgets.3, clearenv.3, cmsg.3, dbopen.3, dirfd.3, dlopen.3, exec.3, fenv.3, ferror.3, fmemopen.3, fnmatch.3, fopen.3, futimes.3, getaddrinfo.3, getifaddrs.3, getipnodebyname.3, hsearch.3, if_nameindex.3, inet_pton.3, mblen.3, mbrlen.3, mbsrtowcs.3, mbtowc.3, mcheck.3, memfrob.3, mq_notify.3, netlink.3, posix_memalign.3, printf.3, pthread_attr_setscope.3, pthread_cleanup_push.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, raise.3, resolver.3, rpc.3, rtime.3, rtnetlink.3, scanf.3, setbuf.3, setnetgrent.3, shm_open.3, sigpause.3, sigset.3, sigwait.3, sockatmark.3, strcasecmp.3, strcmp.3, strdup.3, strftime.3, strptime.3, strsignal.3, strverscmp.3, sysv_signal.3, termios.3, wcrtomb.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wctomb.3, wprintf.3, console_codes.4, cpuid.4, msr.4, rtc.4, sk98lin.4, st.4, tty.4, charmap.5, core.5, elf.5, hosts.equiv.5, proc.5, resolv.conf.5, services.5, slabinfo.5, arp.7, bootparam.7, capabilities.7, charsets.7, cpuset.7, ddp.7, epoll.7, feature_test_macros.7, futex.7, hier.7, icmp.7, inotify.7, ip.7, ipv6.7, man-pages.7, mdoc.7, mdoc.samples.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, posixoptions.7, pthreads.7, raw.7, rtld-audit.7, rtnetlink.7, sem_overview.7, sigevent.7, socket.7, spufs.7, tcp.7, udp.7, unicode.7, uri.7, utf-8.7, intro.8, ldconfig.8, sync.8: Global fix: fix placement of word "only"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-31 08:53:00 +00:00
|
|
|
This option is valid only for
|
2010-09-11 05:19:10 +00:00
|
|
|
.B SOCK_RAW
|
|
|
|
sockets.
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_OPTIONS " (since Linux 2.0)"
|
|
|
|
.\" Precisely: 1.3.30
|
2009-09-27 07:26:41 +00:00
|
|
|
Set or get the IP options to be sent with every packet from this socket.
|
2008-08-08 16:41:48 +00:00
|
|
|
The arguments are a pointer to a memory buffer containing the options
|
|
|
|
and the option length.
|
|
|
|
The
|
|
|
|
.BR setsockopt (2)
|
|
|
|
call sets the IP options associated with a socket.
|
|
|
|
The maximum option size for IPv4 is 40 bytes.
|
2008-11-22 03:02:45 +00:00
|
|
|
See RFC\ 791 for the allowed options.
|
2008-08-08 16:41:48 +00:00
|
|
|
When the initial connection request packet for a
|
|
|
|
.B SOCK_STREAM
|
|
|
|
socket contains IP options, the IP options will be set automatically
|
|
|
|
to the options from the initial packet with routing headers reversed.
|
|
|
|
Incoming packets are not allowed to change options after the connection
|
|
|
|
is established.
|
|
|
|
The processing of all incoming source routing options
|
|
|
|
is disabled by default and can be enabled by using the
|
2008-11-20 19:09:35 +00:00
|
|
|
.I accept_source_route
|
connect.2, listen.2, send.2, uname.2, cmsg.3, proc.5, arp.7, ddp.7, icmp.7, ip.7, raw.7, socket.7, tcp.7, udp.7: Global fix: eliminate mention of the obsolete sysctl(2) interface
Many pages still mention use of the obsolete sysctl(2) system
call, or used the term "sysctls"; rewrite these mentions to
instead be in terms of /proc interfaces.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-11-20 20:37:11 +00:00
|
|
|
.I /proc
|
|
|
|
interface.
|
2008-08-08 16:41:48 +00:00
|
|
|
Other options like timestamps are still handled.
|
2020-09-19 08:26:21 +00:00
|
|
|
For datagram sockets, IP options can be set only by the local user.
|
2008-08-08 16:41:48 +00:00
|
|
|
Calling
|
|
|
|
.BR getsockopt (2)
|
|
|
|
with
|
|
|
|
.B IP_OPTIONS
|
|
|
|
puts the current IP options used for sending into the supplied buffer.
|
|
|
|
.TP
|
2020-09-17 17:31:43 +00:00
|
|
|
.BR IP_PASSSEC " (since Linux 2.6.17)"
|
|
|
|
.\" commit 2c7946a7bf45ae86736ab3b43d0085e43947945c
|
|
|
|
If labeled IPSEC or NetLabel is configured on the sending and receiving
|
|
|
|
hosts, this option enables receiving of the security context of the peer
|
|
|
|
socket in an ancillary message of type
|
|
|
|
.B SCM_SECURITY
|
|
|
|
retrieved using
|
|
|
|
.BR recvmsg (2).
|
2020-09-19 08:22:55 +00:00
|
|
|
This option is supported only for UDP sockets; for TCP or SCTP sockets,
|
2020-09-17 17:31:43 +00:00
|
|
|
see the description of the
|
|
|
|
.B SO_PEERSEC
|
|
|
|
option below.
|
|
|
|
.IP
|
|
|
|
The value given as an argument to
|
|
|
|
.BR setsockopt (2)
|
|
|
|
and returned as the result of
|
|
|
|
.BR getsockopt (2)
|
|
|
|
is an integer boolean flag.
|
|
|
|
.IP
|
|
|
|
The security context returned in the
|
|
|
|
.B SCM_SECURITY
|
|
|
|
ancillary message
|
|
|
|
is of the same format as the one described under the
|
|
|
|
.B SO_PEERSEC
|
|
|
|
option below.
|
|
|
|
.IP
|
2020-09-19 08:22:55 +00:00
|
|
|
Note: the reuse of the
|
2020-09-17 17:31:43 +00:00
|
|
|
.B SCM_SECURITY
|
2020-09-19 08:22:55 +00:00
|
|
|
message type for the
|
2020-09-17 17:31:43 +00:00
|
|
|
.B IP_PASSSEC
|
2020-09-19 08:22:55 +00:00
|
|
|
socket option was likely a mistake, since other IP control messages use
|
2020-09-17 17:31:43 +00:00
|
|
|
their own numbering scheme in the IP namespace and often use the
|
2020-09-19 08:22:55 +00:00
|
|
|
socket option value as the message type.
|
|
|
|
There is no conflict currently since the IP option with the same value as
|
2020-09-17 17:31:43 +00:00
|
|
|
.B SCM_SECURITY
|
|
|
|
is
|
|
|
|
.B IP_HDRINCL
|
|
|
|
and this is never used for a control message type.
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_PKTINFO " (since Linux 2.2)"
|
|
|
|
.\" Precisely: 2.1.68
|
2008-08-08 16:41:48 +00:00
|
|
|
Pass an
|
|
|
|
.B IP_PKTINFO
|
|
|
|
ancillary message that contains a
|
|
|
|
.I pktinfo
|
|
|
|
structure that supplies some information about the incoming packet.
|
2020-09-19 08:26:21 +00:00
|
|
|
This works only for datagram oriented sockets.
|
2008-08-08 16:41:48 +00:00
|
|
|
The argument is a flag that tells the socket whether the
|
|
|
|
.B IP_PKTINFO
|
|
|
|
message should be passed or not.
|
2020-09-19 08:26:21 +00:00
|
|
|
The message itself can be sent/retrieved
|
|
|
|
only as a control message with a packet using
|
2008-08-08 16:41:48 +00:00
|
|
|
.BR recvmsg (2)
|
|
|
|
or
|
|
|
|
.BR sendmsg (2).
|
|
|
|
.IP
|
|
|
|
.in +4n
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EX
|
2008-08-08 16:41:48 +00:00
|
|
|
struct in_pktinfo {
|
|
|
|
unsigned int ipi_ifindex; /* Interface index */
|
|
|
|
struct in_addr ipi_spec_dst; /* Local address */
|
|
|
|
struct in_addr ipi_addr; /* Header Destination
|
|
|
|
address */
|
|
|
|
};
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EE
|
2008-08-08 16:41:48 +00:00
|
|
|
.in
|
|
|
|
.IP
|
|
|
|
.I ipi_ifindex
|
|
|
|
is the unique index of the interface the packet was received on.
|
|
|
|
.I ipi_spec_dst
|
|
|
|
is the local address of the packet and
|
|
|
|
.I ipi_addr
|
|
|
|
is the destination address in the packet header.
|
|
|
|
If
|
|
|
|
.B IP_PKTINFO
|
|
|
|
is passed to
|
|
|
|
.BR sendmsg (2)
|
|
|
|
and
|
|
|
|
.\" This field is grossly misnamed
|
|
|
|
.I ipi_spec_dst
|
|
|
|
is not zero, then it is used as the local source address for the routing
|
|
|
|
table lookup and for setting up IP source route options.
|
|
|
|
When
|
|
|
|
.I ipi_ifindex
|
2008-11-22 02:51:43 +00:00
|
|
|
is not zero, the primary local address of the interface specified by the
|
2008-08-08 16:41:48 +00:00
|
|
|
index overwrites
|
|
|
|
.I ipi_spec_dst
|
|
|
|
for the routing table lookup.
|
|
|
|
.TP
|
2008-11-24 16:22:19 +00:00
|
|
|
.BR IP_RECVERR " (since Linux 2.2)"
|
2008-11-24 15:28:30 +00:00
|
|
|
.\" Precisely: 2.1.15
|
2008-08-08 16:41:48 +00:00
|
|
|
Enable extended reliable error message passing.
|
2008-11-22 02:51:43 +00:00
|
|
|
When enabled on a datagram socket, all
|
2008-08-08 16:41:48 +00:00
|
|
|
generated errors will be queued in a per-socket error queue.
|
2008-11-22 03:02:45 +00:00
|
|
|
When the user receives an error from a socket operation,
|
|
|
|
the errors can be received by calling
|
2008-08-08 16:41:48 +00:00
|
|
|
.BR recvmsg (2)
|
|
|
|
with the
|
|
|
|
.B MSG_ERRQUEUE
|
|
|
|
flag set.
|
|
|
|
The
|
|
|
|
.I sock_extended_err
|
|
|
|
structure describing the error will be passed in an ancillary message with
|
|
|
|
the type
|
|
|
|
.B IP_RECVERR
|
|
|
|
and the level
|
|
|
|
.BR IPPROTO_IP .
|
|
|
|
.\" or SOL_IP on Linux
|
|
|
|
This is useful for reliable error handling on unconnected sockets.
|
2008-11-22 03:02:45 +00:00
|
|
|
The received data portion of the error queue contains the error packet.
|
2008-08-08 16:41:48 +00:00
|
|
|
.IP
|
|
|
|
The
|
|
|
|
.B IP_RECVERR
|
|
|
|
control message contains a
|
|
|
|
.I sock_extended_err
|
|
|
|
structure:
|
|
|
|
.IP
|
|
|
|
.in +4n
|
getrlimit.2, signalfd.2, statfs.2, tee.2, dlopen.3, duplocale.3, ftw.3, get_nprocs.3, mbstowcs.3, posix_spawn.3, strftime.3, full.4, fanotify.7, inotify.7, ip.7, netdevice.7, rtld-audit.7, unix.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-19 19:02:23 +00:00
|
|
|
.EX
|
2008-08-08 16:41:48 +00:00
|
|
|
#define SO_EE_ORIGIN_NONE 0
|
|
|
|
#define SO_EE_ORIGIN_LOCAL 1
|
|
|
|
#define SO_EE_ORIGIN_ICMP 2
|
|
|
|
#define SO_EE_ORIGIN_ICMP6 3
|
|
|
|
|
|
|
|
struct sock_extended_err {
|
|
|
|
uint32_t ee_errno; /* error number */
|
|
|
|
uint8_t ee_origin; /* where the error originated */
|
|
|
|
uint8_t ee_type; /* type */
|
|
|
|
uint8_t ee_code; /* code */
|
|
|
|
uint8_t ee_pad;
|
|
|
|
uint32_t ee_info; /* additional information */
|
|
|
|
uint32_t ee_data; /* other data */
|
|
|
|
/* More data may follow */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EE
|
2008-08-08 16:41:48 +00:00
|
|
|
.in
|
|
|
|
.IP
|
|
|
|
.I ee_errno
|
|
|
|
contains the
|
|
|
|
.I errno
|
|
|
|
number of the queued error.
|
|
|
|
.I ee_origin
|
|
|
|
is the origin code of where the error originated.
|
|
|
|
The other fields are protocol-specific.
|
|
|
|
The macro
|
|
|
|
.B SO_EE_OFFENDER
|
|
|
|
returns a pointer to the address of the network object
|
|
|
|
where the error originated from given a pointer to the ancillary message.
|
|
|
|
If this address is not known, the
|
|
|
|
.I sa_family
|
|
|
|
member of the
|
|
|
|
.I sockaddr
|
|
|
|
contains
|
|
|
|
.B AF_UNSPEC
|
|
|
|
and the other fields of the
|
|
|
|
.I sockaddr
|
|
|
|
are undefined.
|
|
|
|
.IP
|
|
|
|
IP uses the
|
|
|
|
.I sock_extended_err
|
|
|
|
structure as follows:
|
|
|
|
.I ee_origin
|
|
|
|
is set to
|
|
|
|
.B SO_EE_ORIGIN_ICMP
|
|
|
|
for errors received as an ICMP packet, or
|
|
|
|
.B SO_EE_ORIGIN_LOCAL
|
|
|
|
for locally generated errors.
|
|
|
|
Unknown values should be ignored.
|
|
|
|
.I ee_type
|
|
|
|
and
|
|
|
|
.I ee_code
|
|
|
|
are set from the type and code fields of the ICMP header.
|
|
|
|
.I ee_info
|
|
|
|
contains the discovered MTU for
|
|
|
|
.B EMSGSIZE
|
|
|
|
errors.
|
|
|
|
The message also contains the
|
|
|
|
.I sockaddr_in of the node
|
|
|
|
caused the error, which can be accessed with the
|
|
|
|
.B SO_EE_OFFENDER
|
|
|
|
macro.
|
|
|
|
The
|
|
|
|
.I sin_family
|
2010-10-24 06:20:28 +00:00
|
|
|
field of the
|
|
|
|
.B SO_EE_OFFENDER
|
|
|
|
address is
|
2008-08-08 16:41:48 +00:00
|
|
|
.B AF_UNSPEC
|
|
|
|
when the source was unknown.
|
|
|
|
When the error originated from the network, all IP options
|
2020-06-20 17:06:40 +00:00
|
|
|
.RB ( IP_OPTIONS ", " IP_TTL ,
|
2008-08-08 16:41:48 +00:00
|
|
|
etc.) enabled on the socket and contained in the
|
|
|
|
error packet are passed as control messages.
|
2008-11-22 03:02:45 +00:00
|
|
|
The payload of the packet causing the error is returned as normal payload.
|
2008-08-08 16:41:48 +00:00
|
|
|
.\" FIXME . Is it a good idea to document that? It is a dubious feature.
|
|
|
|
.\" On
|
|
|
|
.\" .B SOCK_STREAM
|
|
|
|
.\" sockets,
|
|
|
|
.\" .B IP_RECVERR
|
|
|
|
.\" has slightly different semantics. Instead of
|
|
|
|
.\" saving the errors for the next timeout, it passes all incoming
|
|
|
|
.\" errors immediately to the user.
|
|
|
|
.\" This might be useful for very short-lived TCP connections which
|
|
|
|
.\" need fast error handling. Use this option with care:
|
|
|
|
.\" it makes TCP unreliable
|
|
|
|
.\" by not allowing it to recover properly from routing
|
|
|
|
.\" shifts and other normal
|
|
|
|
.\" conditions and breaks the protocol specification.
|
|
|
|
Note that TCP has no error queue;
|
|
|
|
.B MSG_ERRQUEUE
|
|
|
|
is not permitted on
|
|
|
|
.B SOCK_STREAM
|
|
|
|
sockets.
|
|
|
|
.B IP_RECVERR
|
2008-11-22 03:02:45 +00:00
|
|
|
is valid for TCP, but all errors are returned by socket function return or
|
2008-08-08 16:41:48 +00:00
|
|
|
.B SO_ERROR
|
|
|
|
only.
|
|
|
|
.IP
|
|
|
|
For raw sockets,
|
|
|
|
.B IP_RECVERR
|
|
|
|
enables passing of all received ICMP errors to the
|
2020-09-19 08:26:21 +00:00
|
|
|
application, otherwise errors are reported only on connected sockets
|
2008-08-08 16:41:48 +00:00
|
|
|
.IP
|
|
|
|
It sets or retrieves an integer boolean flag.
|
|
|
|
.B IP_RECVERR
|
|
|
|
defaults to off.
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_RECVOPTS " (since Linux 2.2)"
|
|
|
|
.\" Precisely: 2.1.15
|
2008-11-22 03:15:38 +00:00
|
|
|
Pass all incoming IP options to the user in a
|
|
|
|
.B IP_OPTIONS
|
|
|
|
control message.
|
|
|
|
The routing header and other options are already filled in
|
|
|
|
for the local host.
|
|
|
|
Not supported for
|
2008-08-08 16:41:48 +00:00
|
|
|
.B SOCK_STREAM
|
2008-11-22 03:15:38 +00:00
|
|
|
sockets.
|
2008-08-08 16:41:48 +00:00
|
|
|
.TP
|
2010-10-24 06:16:40 +00:00
|
|
|
.BR IP_RECVORIGDSTADDR " (since Linux 2.6.29)"
|
|
|
|
.\" commit e8b2dfe9b4501ed0047459b2756ba26e5a940a69
|
|
|
|
This boolean option enables the
|
|
|
|
.B IP_ORIGDSTADDR
|
|
|
|
ancillary message in
|
|
|
|
.BR recvmsg (2),
|
|
|
|
in which the kernel returns the original destination address
|
|
|
|
of the datagram being received.
|
|
|
|
The ancillary message contains a
|
|
|
|
.IR "struct sockaddr_in" .
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_RECVTOS " (since Linux 2.2)"
|
|
|
|
.\" Precisely: 2.1.68
|
2014-03-26 05:00:11 +00:00
|
|
|
If enabled, the
|
2008-11-22 03:15:38 +00:00
|
|
|
.B IP_TOS
|
|
|
|
ancillary message is passed with incoming packets.
|
|
|
|
It contains a byte which specifies the Type of Service/Precedence
|
|
|
|
field of the packet header.
|
|
|
|
Expects a boolean integer flag.
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_RECVTTL " (since Linux 2.2)"
|
|
|
|
.\" Precisely: 2.1.68
|
2008-11-22 03:15:38 +00:00
|
|
|
When this flag is set, pass a
|
|
|
|
.B IP_TTL
|
2015-03-27 13:27:26 +00:00
|
|
|
control message with the time-to-live
|
ip.7: IP_RECVTTL error fixed
I need to get the TTL of UDP datagrams from userspace, so I set
the IP_RECVTTL socket option. And as promised by ip.7, I then get
IP_TTL messages from recvfrom. However, unlike what the manpage
promises, the TTL field gets passed as a 32 bit integer.
The following userspace code works:
uint32_t ttl32;
for (cmsg = CMSG_FIRSTHDR(msgh); cmsg != NULL; cmsg = CMSG_NXTHDR(msgh,cmsg)) {
if ((cmsg->cmsg_level == IPPROTO_IP) && (cmsg->cmsg_type == IP_TTL) &&
CMSG_LEN(sizeof(ttl32)) == cmsg->cmsg_len) {
memcpy(&ttl32, CMSG_DATA(cmsg), sizeof(ttl32));
*ttl=ttl32;
return true;
}
else
cerr<<"Saw something else "<<(cmsg->cmsg_type == IP_TTL) <<
", "<<(int)cmsg->cmsg_level<<", "<<cmsg->cmsg_len<<", "<<
CMSG_LEN(1)<<endl;
}
The 'else' field was used to figure out I go the length wrong.
Note from mtk:
Reading the source code also seems to confirm this, from
net/ipv4/ip_sockglue.c:
[[
static void ip_cmsg_recv_ttl(struct msghdr *msg, struct sk_buff *skb)
{
int ttl = ip_hdr(skb)->ttl;
put_cmsg(msg, SOL_IP, IP_TTL, sizeof(int), &ttl);
}
]]
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-02-24 10:18:11 +00:00
|
|
|
field of the received packet as a 32 bit integer.
|
2008-11-22 03:15:38 +00:00
|
|
|
Not supported for
|
|
|
|
.B SOCK_STREAM
|
|
|
|
sockets.
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_RETOPTS " (since Linux 2.2)"
|
|
|
|
.\" Precisely: 2.1.15
|
2008-11-22 03:15:38 +00:00
|
|
|
Identical to
|
|
|
|
.BR IP_RECVOPTS ,
|
|
|
|
but returns raw unprocessed options with timestamp and route record
|
|
|
|
options not filled in for this hop.
|
2008-08-08 16:41:48 +00:00
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_ROUTER_ALERT " (since Linux 2.2)"
|
|
|
|
.\" Precisely: 2.1.68
|
2008-08-08 16:41:48 +00:00
|
|
|
Pass all to-be forwarded packets with the
|
2008-11-22 03:02:45 +00:00
|
|
|
IP Router Alert option set to this socket.
|
2015-05-06 09:52:59 +00:00
|
|
|
Valid only for raw sockets.
|
2008-11-22 02:51:43 +00:00
|
|
|
This is useful, for instance, for user-space RSVP daemons.
|
|
|
|
The tapped packets are not forwarded by the kernel; it is
|
|
|
|
the user's responsibility to send them out again.
|
2008-08-08 16:41:48 +00:00
|
|
|
Socket binding is ignored,
|
2020-09-19 08:26:21 +00:00
|
|
|
such packets are filtered only by protocol.
|
2008-08-08 16:41:48 +00:00
|
|
|
Expects an integer flag.
|
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_TOS " (since Linux 1.0)"
|
2008-11-22 03:15:38 +00:00
|
|
|
Set or receive the Type-Of-Service (TOS) field that is sent
|
|
|
|
with every IP packet originating from this socket.
|
|
|
|
It is used to prioritize packets on the network.
|
|
|
|
TOS is a byte.
|
|
|
|
There are some standard TOS flags defined:
|
|
|
|
.B IPTOS_LOWDELAY
|
|
|
|
to minimize delays for interactive traffic,
|
|
|
|
.B IPTOS_THROUGHPUT
|
|
|
|
to optimize throughput,
|
|
|
|
.B IPTOS_RELIABILITY
|
|
|
|
to optimize for reliability,
|
|
|
|
.B IPTOS_MINCOST
|
|
|
|
should be used for "filler data" where slow transmission doesn't matter.
|
|
|
|
At most one of these TOS values can be specified.
|
|
|
|
Other bits are invalid and shall be cleared.
|
|
|
|
Linux sends
|
|
|
|
.B IPTOS_LOWDELAY
|
|
|
|
datagrams first by default,
|
|
|
|
but the exact behavior depends on the configured queueing discipline.
|
|
|
|
.\" FIXME elaborate on this
|
2015-03-27 13:27:26 +00:00
|
|
|
Some high-priority levels may require superuser privileges (the
|
2008-11-22 03:15:38 +00:00
|
|
|
.B CAP_NET_ADMIN
|
|
|
|
capability).
|
2015-05-05 19:18:51 +00:00
|
|
|
.\" The priority can also be set in a protocol-independent way by the
|
|
|
|
.\" .RB ( SOL_SOCKET ", " SO_PRIORITY )
|
|
|
|
.\" socket option (see
|
|
|
|
.\" .BR socket (7)).
|
2010-10-13 04:52:59 +00:00
|
|
|
.TP
|
2010-10-24 06:10:25 +00:00
|
|
|
.BR IP_TRANSPARENT " (since Linux 2.6.24)"
|
2010-10-13 04:52:59 +00:00
|
|
|
.\" commit f5715aea4564f233767ea1d944b2637a5fd7cd2e
|
|
|
|
.\" This patch introduces the IP_TRANSPARENT socket option: enabling that
|
|
|
|
.\" will make the IPv4 routing omit the non-local source address check on
|
|
|
|
.\" output. Setting IP_TRANSPARENT requires NET_ADMIN capability.
|
|
|
|
.\" http://lwn.net/Articles/252545/
|
|
|
|
Setting this boolean option enables transparent proxying on this socket.
|
|
|
|
This socket option allows
|
|
|
|
the calling application to bind to a nonlocal IP address and operate
|
|
|
|
both as a client and a server with the foreign address as the local endpoint.
|
|
|
|
NOTE: this requires that routing be set up in a way that
|
2014-05-02 11:36:16 +00:00
|
|
|
packets going to the foreign address are routed through the TProxy box
|
|
|
|
(i.e., the system hosting the application that employs the
|
|
|
|
.B IP_TRANSPARENT
|
|
|
|
socket option).
|
2010-10-13 04:52:59 +00:00
|
|
|
Enabling this socket option requires superuser privileges
|
|
|
|
(the
|
|
|
|
.BR CAP_NET_ADMIN
|
|
|
|
capability).
|
|
|
|
.IP
|
|
|
|
TProxy redirection with the iptables TPROXY target also requires that
|
|
|
|
this option be set on the redirected socket.
|
2008-08-08 16:41:48 +00:00
|
|
|
.TP
|
2008-11-24 15:28:30 +00:00
|
|
|
.BR IP_TTL " (since Linux 1.0)"
|
2008-11-22 03:15:38 +00:00
|
|
|
Set or retrieve the current time-to-live field that is used in every packet
|
|
|
|
sent from this socket.
|
2013-02-10 02:33:27 +00:00
|
|
|
.TP
|
2013-02-10 02:44:05 +00:00
|
|
|
.BR IP_UNBLOCK_SOURCE " (since Linux 2.4.22 / 2.5.68)"
|
2013-02-14 00:24:47 +00:00
|
|
|
Unblock previously blocked multicast source.
|
|
|
|
Returns
|
2013-02-10 02:33:27 +00:00
|
|
|
.BR EADDRNOTAVAIL
|
|
|
|
when given source is not being blocked.
|
|
|
|
.IP
|
|
|
|
Argument is an
|
|
|
|
.I ip_mreq_source
|
2013-02-10 02:44:05 +00:00
|
|
|
structure as described under
|
2013-02-10 02:33:27 +00:00
|
|
|
.BR IP_ADD_SOURCE_MEMBERSHIP .
|
2020-09-15 16:39:59 +00:00
|
|
|
.TP
|
|
|
|
.BR SO_PEERSEC " (since Linux 2.6.17)"
|
|
|
|
If labeled IPSEC or NetLabel is configured on both the sending and
|
|
|
|
receiving hosts, this read-only socket option returns the security
|
2020-09-17 07:33:46 +00:00
|
|
|
context of the peer socket connected to this socket.
|
|
|
|
By default,
|
|
|
|
this will be the same as the security context of the process that created
|
2020-09-15 16:39:59 +00:00
|
|
|
the peer socket unless overridden by the policy or by a process with
|
|
|
|
the required permissions.
|
|
|
|
.IP
|
|
|
|
The argument to
|
|
|
|
.BR getsockopt (2)
|
2020-09-17 07:33:46 +00:00
|
|
|
is a pointer to a buffer of the specified length in bytes
|
2020-09-15 16:39:59 +00:00
|
|
|
into which the security context string will be copied.
|
|
|
|
If the buffer length is less than the length of the security
|
|
|
|
context string, then
|
|
|
|
.BR getsockopt (2)
|
2020-09-17 07:42:11 +00:00
|
|
|
returns \-1, sets
|
2020-09-15 16:39:59 +00:00
|
|
|
.I errno
|
|
|
|
to
|
2020-09-17 07:42:11 +00:00
|
|
|
.BR ERANGE ,
|
|
|
|
and returns the required length via
|
|
|
|
.IR optlen .
|
2020-09-15 16:39:59 +00:00
|
|
|
The caller should allocate at least
|
|
|
|
.BR NAME_MAX
|
2020-09-17 07:42:11 +00:00
|
|
|
bytes for the buffer initially, although this is not guaranteed
|
2020-09-17 07:33:46 +00:00
|
|
|
to be sufficient.
|
|
|
|
Resizing the buffer to the returned length
|
2020-09-15 16:39:59 +00:00
|
|
|
and retrying may be necessary.
|
|
|
|
.IP
|
|
|
|
The security context string may include a terminating null character
|
|
|
|
in the returned length, but is not guaranteed to do so: a security
|
|
|
|
context "foo" might be represented as either {'f','o','o'} of length 3
|
|
|
|
or {'f','o','o','\\0'} of length 4, which are considered to be
|
2020-09-17 07:33:46 +00:00
|
|
|
interchangeable.
|
2020-09-17 07:42:11 +00:00
|
|
|
The string is printable, does not contain non-terminating null characters,
|
|
|
|
and is in an unspecified encoding (in particular, it
|
2020-09-15 16:39:59 +00:00
|
|
|
is not guaranteed to be ASCII or UTF-8).
|
|
|
|
.IP
|
|
|
|
The use of this option for sockets in the
|
|
|
|
.B AF_INET
|
2020-09-17 07:33:46 +00:00
|
|
|
address family is supported since Linux 2.6.17
|
2020-09-15 16:39:59 +00:00
|
|
|
.\" commit 2c7946a7bf45ae86736ab3b43d0085e43947945c
|
2020-09-17 07:42:11 +00:00
|
|
|
for TCP sockets, and since Linux 4.17
|
2020-09-15 16:39:59 +00:00
|
|
|
.\" commit d452930fd3b9031e59abfeddb2fa383f1403d61a
|
|
|
|
for SCTP sockets.
|
|
|
|
.IP
|
2020-09-19 08:26:21 +00:00
|
|
|
For SELinux, NetLabel conveys only the MLS portion of the security
|
2020-09-15 16:39:59 +00:00
|
|
|
context of the peer across the wire, defaulting the rest of the
|
|
|
|
security context to the values defined in the policy for the
|
2020-09-17 07:33:46 +00:00
|
|
|
netmsg initial security identifier (SID).
|
|
|
|
However, NetLabel can
|
|
|
|
be configured to pass full security contexts over loopback.
|
|
|
|
Labeled IPSEC always passes full security contexts as part of establishing
|
2020-09-15 16:39:59 +00:00
|
|
|
the security association (SA) and looks them up based on the association
|
|
|
|
for each packet.
|
2020-09-17 07:42:11 +00:00
|
|
|
.\"
|
connect.2, listen.2, send.2, uname.2, cmsg.3, proc.5, arp.7, ddp.7, icmp.7, ip.7, raw.7, socket.7, tcp.7, udp.7: Global fix: eliminate mention of the obsolete sysctl(2) interface
Many pages still mention use of the obsolete sysctl(2) system
call, or used the term "sysctls"; rewrite these mentions to
instead be in terms of /proc interfaces.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-11-20 20:37:11 +00:00
|
|
|
.SS /proc interfaces
|
2008-08-08 16:41:48 +00:00
|
|
|
The IP protocol
|
connect.2, listen.2, send.2, uname.2, cmsg.3, proc.5, arp.7, ddp.7, icmp.7, ip.7, raw.7, socket.7, tcp.7, udp.7: Global fix: eliminate mention of the obsolete sysctl(2) interface
Many pages still mention use of the obsolete sysctl(2) system
call, or used the term "sysctls"; rewrite these mentions to
instead be in terms of /proc interfaces.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-11-20 20:37:11 +00:00
|
|
|
supports a set of
|
|
|
|
.I /proc
|
|
|
|
interfaces to configure some global parameters.
|
|
|
|
The parameters can be accessed by reading or writing files in the directory
|
|
|
|
.IR /proc/sys/net/ipv4/ .
|
2008-08-08 16:41:48 +00:00
|
|
|
.\" FIXME As at 2.6.12, 14 Jun 2005, the following are undocumented:
|
2016-10-29 10:45:35 +00:00
|
|
|
.\" ip_queue_maxlen
|
|
|
|
.\" ip_conntrack_max
|
connect.2, listen.2, send.2, uname.2, cmsg.3, proc.5, arp.7, ddp.7, icmp.7, ip.7, raw.7, socket.7, tcp.7, udp.7: Global fix: eliminate mention of the obsolete sysctl(2) interface
Many pages still mention use of the obsolete sysctl(2) system
call, or used the term "sysctls"; rewrite these mentions to
instead be in terms of /proc interfaces.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-11-20 20:37:11 +00:00
|
|
|
Interfaces described as
|
2008-08-08 16:41:48 +00:00
|
|
|
.I Boolean
|
intro.1, time.1, adjtimex.2, capget.2, eventfd.2, fcntl.2, getrlimit.2, getsockopt.2, gettimeofday.2, intro.2, ioctl_list.2, ioperm.2, mlock.2, pivot_root.2, poll.2, prctl.2, ptrace.2, sched_setscheduler.2, select_tut.2, semget.2, sigaltstack.2, signalfd.2, sysctl.2, timer_settime.2, timerfd_create.2, wait.2, CPU_SET.3, argz_add.3, assert_perror.3, atexit.3, backtrace.3, bcmp.3, clearenv.3, ctime.3, dl_iterate_phdr.3, dlopen.3, ecvt.3, errno.3, error.3, ether_aton.3, exit.3, fenv.3, ferror.3, finite.3, flockfile.3, fnmatch.3, fpathconf.3, fpclassify.3, ftime.3, ftok.3, ftw.3, fwide.3, getaddrinfo.3, gethostbyname.3, getlogin.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getrpcent.3, getservent.3, glob.3, hsearch.3, inet.3, isalpha.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, longjmp.3, lsearch.3, malloc.3, matherr.3, mblen.3, mbsinit.3, mbtowc.3, on_exit.3, printf.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_equal.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setschedparam.3, pthread_setschedprio.3, ptsname.3, putenv.3, putgrent.3, raise.3, rcmd.3, regex.3, rexec.3, rpc.3, rpmatch.3, rtnetlink.3, scandir.3, sem_init.3, setaliasent.3, setbuf.3, setenv.3, setjmp.3, signbit.3, stdio_ext.3, strtod.3, strtol.3, strtoul.3, system.3, termios.3, timeradd.3, tzset.3, ualarm.3, wctomb.3, xdr.3, st.4, tty_ioctl.4, core.5, elf.5, proc.5, bootparam.7, capabilities.7, icmp.7, ip.7, ipv6.7, math_error.7, mdoc.samples.7, mq_overview.7, pthreads.7, raw.7, regex.7, socket.7, tcp.7, tzselect.8: Global fix: s/non-zero/nonzero/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:40:55 +00:00
|
|
|
take an integer value, with a nonzero value ("true") meaning that
|
2008-08-08 16:41:48 +00:00
|
|
|
the corresponding option is enabled, and a zero value ("false")
|
|
|
|
meaning that the option is disabled.
|
|
|
|
.\"
|
|
|
|
.TP
|
2008-11-24 14:46:05 +00:00
|
|
|
.IR ip_always_defrag " (Boolean; since Linux 2.2.13)"
|
2008-08-08 16:41:48 +00:00
|
|
|
[New with kernel 2.2.13; in earlier kernel versions this feature
|
|
|
|
was controlled at compile time by the
|
|
|
|
.B CONFIG_IP_ALWAYS_DEFRAG
|
|
|
|
option; this option is not present in 2.4.x and later]
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.IP
|
2009-09-27 07:26:41 +00:00
|
|
|
When this boolean flag is enabled (not equal 0), incoming fragments
|
2008-08-08 16:41:48 +00:00
|
|
|
(parts of IP packets
|
|
|
|
that arose when some host between origin and destination decided
|
|
|
|
that the packets were too large and cut them into pieces) will be
|
|
|
|
reassembled (defragmented) before being processed, even if they are
|
|
|
|
about to be forwarded.
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.IP
|
2016-11-11 08:32:09 +00:00
|
|
|
Enable only if running either a firewall that is the sole link
|
2008-08-08 16:41:48 +00:00
|
|
|
to your network or a transparent proxy; never ever use it for a
|
|
|
|
normal router or host.
|
time.1, get_kernel_syms.2, getitimer.2, open.2, perf_event_open.2, wait.2, alloca.3, bcmp.3, catopen.3, fputwc.3, iconv.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, mbsinit.3, putwchar.3, rcmd.3, rexec.3, sigqueue.3, strverscmp.3, wctrans.3, wctype.3, wcwidth.3, console_codes.4, initrd.4, st.4, elf.5, nss.5, ip.7, netdevice.7, path_resolution.7, socket.7, udp.7, ld.so.8: grfix: s/Otherwise /Otherwise, /
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-28 08:15:47 +00:00
|
|
|
Otherwise, fragmented communication can be disturbed
|
2008-08-08 16:41:48 +00:00
|
|
|
if the fragments travel over different links.
|
|
|
|
Defragmentation also has a large memory and CPU time cost.
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.IP
|
2008-08-08 16:41:48 +00:00
|
|
|
This is automagically turned on when masquerading or transparent
|
|
|
|
proxying are configured.
|
|
|
|
.\"
|
|
|
|
.TP
|
2008-11-24 14:46:05 +00:00
|
|
|
.IR ip_autoconfig " (since Linux 2.2 to 2.6.17)"
|
|
|
|
.\" Precisely: since 2.1.68
|
2008-08-08 16:41:48 +00:00
|
|
|
.\" FIXME document ip_autoconfig
|
|
|
|
Not documented.
|
|
|
|
.\"
|
|
|
|
.TP
|
2008-11-24 14:46:05 +00:00
|
|
|
.IR ip_default_ttl " (integer; default: 64; since Linux 2.2)"
|
|
|
|
.\" Precisely: 2.1.15
|
2008-08-08 16:41:48 +00:00
|
|
|
Set the default time-to-live value of outgoing packets.
|
|
|
|
This can be changed per socket with the
|
|
|
|
.B IP_TTL
|
|
|
|
option.
|
|
|
|
.\"
|
|
|
|
.TP
|
2008-11-24 14:46:05 +00:00
|
|
|
.IR ip_dynaddr " (Boolean; default: disabled; since Linux 2.0.31)"
|
2008-08-08 16:41:48 +00:00
|
|
|
Enable dynamic socket address and masquerading entry rewriting on interface
|
|
|
|
address change.
|
|
|
|
This is useful for dialup interface with changing IP addresses.
|
|
|
|
0 means no rewriting, 1 turns it on and 2 enables verbose mode.
|
|
|
|
.\"
|
|
|
|
.TP
|
2008-11-24 14:46:05 +00:00
|
|
|
.IR ip_forward " (Boolean; default: disabled; since Linux 1.2)"
|
2008-08-08 16:41:48 +00:00
|
|
|
Enable IP forwarding with a boolean flag.
|
2008-11-24 15:28:30 +00:00
|
|
|
IP forwarding can be also set on a per-interface basis.
|
2008-08-08 16:41:48 +00:00
|
|
|
.\"
|
|
|
|
.TP
|
2008-11-24 14:46:05 +00:00
|
|
|
.IR ip_local_port_range " (since Linux 2.2)"
|
|
|
|
.\" Precisely: since 2.1.68
|
2014-04-26 10:06:23 +00:00
|
|
|
This file contains two integers that define the default local port range
|
|
|
|
allocated to sockets that are not explicitly bound to a port number\(emthat
|
|
|
|
is, the range used for
|
|
|
|
.IR "ephemeral ports" .
|
2014-04-26 10:16:39 +00:00
|
|
|
An ephemeral port is allocated to a socket in the following circumstances:
|
|
|
|
.RS
|
|
|
|
.IP * 3
|
|
|
|
the port number in a socket address is specified as 0 when calling
|
|
|
|
.BR bind (2);
|
|
|
|
.IP *
|
|
|
|
.BR listen (2)
|
|
|
|
is called on a stream socket that was not previously bound;
|
|
|
|
.IP *
|
|
|
|
.BR connect (2)
|
2014-09-10 21:38:32 +00:00
|
|
|
was called on a socket that was not previously bound;
|
2014-04-26 10:16:39 +00:00
|
|
|
.IP *
|
|
|
|
.BR sendto (2)
|
2014-09-10 21:38:32 +00:00
|
|
|
is called on a datagram socket that was not previously bound.
|
2014-04-26 10:16:39 +00:00
|
|
|
.RE
|
|
|
|
.IP
|
2014-04-26 10:20:09 +00:00
|
|
|
Allocation of ephemeral ports starts with the first number in
|
|
|
|
.IR ip_local_port_range
|
|
|
|
and ends with the second number.
|
|
|
|
If the range of ephemeral ports is exhausted,
|
2014-09-10 21:38:32 +00:00
|
|
|
then the relevant system call returns an error (but see BUGS).
|
2014-04-26 10:20:09 +00:00
|
|
|
.IP
|
|
|
|
Note that the port range in
|
|
|
|
.IR ip_local_port_range
|
|
|
|
should not conflict with the ports used by masquerading
|
2008-08-08 16:41:48 +00:00
|
|
|
(although the case is handled).
|
2014-04-26 09:35:39 +00:00
|
|
|
Also, arbitrary choices may cause problems with some firewall packet
|
2008-08-08 16:41:48 +00:00
|
|
|
filters that make assumptions about the local ports in use.
|
2014-04-26 10:20:09 +00:00
|
|
|
The first number should be at least greater than 1024,
|
2008-11-22 02:55:11 +00:00
|
|
|
or better, greater than 4096, to avoid clashes
|
2008-08-08 16:41:48 +00:00
|
|
|
with well known ports and to minimize firewall problems.
|
|
|
|
.\"
|
|
|
|
.TP
|
2008-11-24 14:46:05 +00:00
|
|
|
.IR ip_no_pmtu_disc " (Boolean; default: disabled; since Linux 2.2)"
|
|
|
|
.\" Precisely: 2.1.15
|
2008-08-08 16:41:48 +00:00
|
|
|
If enabled, don't do Path MTU Discovery for TCP sockets by default.
|
|
|
|
Path MTU discovery may fail if misconfigured firewalls (that drop
|
|
|
|
all ICMP packets) or misconfigured interfaces (e.g., a point-to-point
|
|
|
|
link where the both ends don't agree on the MTU) are on the path.
|
|
|
|
It is better to fix the broken routers on the path than to turn off
|
|
|
|
Path MTU Discovery globally, because not doing it incurs a high cost
|
|
|
|
to the network.
|
|
|
|
.\"
|
|
|
|
.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
|
|
|
|
.TP
|
2008-11-24 14:46:05 +00:00
|
|
|
.IR ip_nonlocal_bind " (Boolean; default: disabled; since Linux 2.4)"
|
|
|
|
.\" Precisely: patch-2.4.0-test10
|
2008-08-08 16:41:48 +00:00
|
|
|
If set, allows processes to
|
|
|
|
.BR bind (2)
|
accept.2, access.2, acct.2, clock_nanosleep.2, mbind.2, mincore.2, remap_file_pages.2, sched_setscheduler.2, set_mempolicy.2, splice.2, stat.2, syslog.2, timer_create.2, timerfd_create.2, truncate.2, fenv.3, ferror.3, fflush.3, fgetwc.3, fgetws.3, flockfile.3, fputwc.3, fputws.3, fread.3, getopt.3, gets.3, getwchar.3, glob.3, iconv.3, longjmp.3, pow.3, printf.3, puts.3, putwchar.3, regex.3, rpc.3, scanf.3, setjmp.3, termios.3, unlocked_stdio.3, wcswidth.3, hd.4, rtc.4, st.4, core.5, dir_colors.5, elf.5, proc.5, arp.7, ascii.7, boot.7, bootparam.7, charsets.7, futex.7, ip.7, iso_8859-11.7, man-pages.7, man.7, mdoc.samples.7, path_resolution.7, pipe.7, posixoptions.7, unicode.7, unix.7, uri.7, utf-8.7, ld.so.8: s/non-/non/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 17:20:12 +00:00
|
|
|
to nonlocal IP addresses,
|
2008-08-08 16:41:48 +00:00
|
|
|
which can be quite useful, but may break some applications.
|
|
|
|
.\"
|
|
|
|
.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
|
|
|
|
.TP
|
2010-10-13 03:52:51 +00:00
|
|
|
.IR ip6frag_time " (integer; default: 30)"
|
2008-08-08 16:41:48 +00:00
|
|
|
Time in seconds to keep an IPv6 fragment in memory.
|
|
|
|
.\"
|
|
|
|
.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
|
|
|
|
.TP
|
2010-10-13 03:52:51 +00:00
|
|
|
.IR ip6frag_secret_interval " (integer; default: 600)"
|
2008-08-08 16:41:48 +00:00
|
|
|
Regeneration interval (in seconds) of the hash secret (or lifetime
|
|
|
|
for the hash secret) for IPv6 fragments.
|
|
|
|
.TP
|
2008-11-20 19:09:35 +00:00
|
|
|
.IR ipfrag_high_thresh " (integer), " ipfrag_low_thresh " (integer)"
|
2008-08-08 16:41:48 +00:00
|
|
|
If the amount of queued IP fragments reaches
|
2008-11-20 19:09:35 +00:00
|
|
|
.IR ipfrag_high_thresh ,
|
2008-11-22 03:02:45 +00:00
|
|
|
the queue is pruned down to
|
2008-11-20 19:09:35 +00:00
|
|
|
.IR ipfrag_low_thresh .
|
2008-11-22 03:02:45 +00:00
|
|
|
Contains an integer with the number of bytes.
|
2008-08-08 16:41:48 +00:00
|
|
|
.TP
|
2008-11-20 19:09:35 +00:00
|
|
|
.I neigh/*
|
2008-08-08 16:41:48 +00:00
|
|
|
See
|
|
|
|
.BR arp (7).
|
connect.2, listen.2, send.2, uname.2, cmsg.3, proc.5, arp.7, ddp.7, icmp.7, ip.7, raw.7, socket.7, tcp.7, udp.7: Global fix: eliminate mention of the obsolete sysctl(2) interface
Many pages still mention use of the obsolete sysctl(2) system
call, or used the term "sysctls"; rewrite these mentions to
instead be in terms of /proc interfaces.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-11-20 20:37:11 +00:00
|
|
|
.\" FIXME Document the conf/*/* interfaces
|
adjtimex.2, bind.2, cacheflush.2, clone.2, fallocate.2, fanotify_init.2, fanotify_mark.2, flock.2, futex.2, getdents.2, getpriority.2, getrlimit.2, gettid.2, gettimeofday.2, ioprio_set.2, kexec_load.2, migrate_pages.2, modify_ldt.2, mount.2, move_pages.2, mprotect.2, msgop.2, nfsservctl.2, perf_event_open.2, pread.2, ptrace.2, recvmmsg.2, rename.2, restart_syscall.2, sched_setattr.2, send.2, shmop.2, shutdown.2, sigaction.2, signalfd.2, syscalls.2, timer_create.2, timerfd_create.2, tkill.2, vmsplice.2, wait.2, aio_init.3, confstr.3, exit.3, fmemopen.3, fopen.3, getaddrinfo.3, getauxval.3, getspnam.3, isalpha.3, isatty.3, mallinfo.3, malloc.3, mallopt.3, psignal.3, pthread_attr_setinheritsched.3, qecvt.3, queue.3, rtnetlink.3, strerror.3, strftime.3, toupper.3, towlower.3, towupper.3, initrd.4, locale.5, proc.5, bootparam.7, capabilities.7, ddp.7, fanotify.7, icmp.7, inotify.7, ip.7, ipv6.7, netdevice.7, netlink.7, path_resolution.7, rtld-audit.7, rtnetlink.7, sched.7, signal.7, socket.7, svipc.7, tcp.7, unix.7, ld.so.8: srcfix: Update FIXMEs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-08-21 21:47:44 +00:00
|
|
|
.\"
|
connect.2, listen.2, send.2, uname.2, cmsg.3, proc.5, arp.7, ddp.7, icmp.7, ip.7, raw.7, socket.7, tcp.7, udp.7: Global fix: eliminate mention of the obsolete sysctl(2) interface
Many pages still mention use of the obsolete sysctl(2) system
call, or used the term "sysctls"; rewrite these mentions to
instead be in terms of /proc interfaces.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-11-20 20:37:11 +00:00
|
|
|
.\" FIXME Document the route/* interfaces
|
2008-08-08 16:41:48 +00:00
|
|
|
.SS Ioctls
|
|
|
|
All ioctls described in
|
|
|
|
.BR socket (7)
|
2008-11-20 19:09:35 +00:00
|
|
|
apply to
|
|
|
|
.BR ip .
|
2008-08-08 16:41:48 +00:00
|
|
|
.PP
|
|
|
|
Ioctls to configure generic device parameters are described in
|
|
|
|
.BR netdevice (7).
|
|
|
|
.\" FIXME Add a discussion of multicasting
|
|
|
|
.SH ERRORS
|
|
|
|
.\" FIXME document all errors.
|
|
|
|
.\" We should really fix the kernels to give more uniform
|
|
|
|
.\" error returns (ENOMEM vs ENOBUFS, EPERM vs EACCES etc.)
|
|
|
|
.TP
|
|
|
|
.B EACCES
|
|
|
|
The user tried to execute an operation without the necessary permissions.
|
|
|
|
These include:
|
|
|
|
sending a packet to a broadcast address without having the
|
|
|
|
.B SO_BROADCAST
|
|
|
|
flag set;
|
|
|
|
sending a packet via a
|
|
|
|
.I prohibit
|
|
|
|
route;
|
|
|
|
modifying firewall settings without superuser privileges (the
|
|
|
|
.B CAP_NET_ADMIN
|
|
|
|
capability);
|
2008-12-04 11:37:25 +00:00
|
|
|
binding to a privileged port without superuser privileges (the
|
2008-08-08 16:41:48 +00:00
|
|
|
.B CAP_NET_BIND_SERVICE
|
|
|
|
capability).
|
|
|
|
.TP
|
|
|
|
.B EADDRINUSE
|
|
|
|
Tried to bind to an address already in use.
|
|
|
|
.TP
|
|
|
|
.B EADDRNOTAVAIL
|
|
|
|
A nonexistent interface was requested or the requested source
|
2008-11-22 03:02:45 +00:00
|
|
|
address was not local.
|
2008-08-08 16:41:48 +00:00
|
|
|
.TP
|
|
|
|
.B EAGAIN
|
accept.2, connect.2, eventfd.2, flock.2, open.2, posix_fadvise.2, read.2, recv.2, sched_setscheduler.2, select_tut.2, send.2, signalfd.2, splice.2, timerfd_create.2, write.2, flockfile.3, mkfifo.3, mq_notify.3, mq_open.3, pthread_tryjoin_np.3, scanf.3, random.4, ddp.7, epoll.7, fifo.7, ip.7, pipe.7, socket.7, spufs.7: Global fix: s/non-blocking/nonblocking/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:43:10 +00:00
|
|
|
Operation on a nonblocking socket would block.
|
2008-08-08 16:41:48 +00:00
|
|
|
.TP
|
|
|
|
.B EALREADY
|
2016-07-07 09:57:37 +00:00
|
|
|
A connection operation on a nonblocking socket is already in progress.
|
2008-08-08 16:41:48 +00:00
|
|
|
.TP
|
|
|
|
.B ECONNABORTED
|
|
|
|
A connection was closed during an
|
|
|
|
.BR accept (2).
|
|
|
|
.TP
|
|
|
|
.B EHOSTUNREACH
|
|
|
|
No valid routing table entry matches the destination address.
|
2017-05-01 21:30:03 +00:00
|
|
|
This error can be caused by an ICMP message from a remote router or
|
2008-08-08 16:41:48 +00:00
|
|
|
for the local routing table.
|
|
|
|
.TP
|
|
|
|
.B EINVAL
|
|
|
|
Invalid argument passed.
|
|
|
|
For send operations this can be caused by sending to a
|
|
|
|
.I blackhole
|
|
|
|
route.
|
|
|
|
.TP
|
|
|
|
.B EISCONN
|
|
|
|
.BR connect (2)
|
|
|
|
was called on an already connected socket.
|
|
|
|
.TP
|
|
|
|
.B EMSGSIZE
|
|
|
|
Datagram is bigger than an MTU on the path and it cannot be fragmented.
|
|
|
|
.TP
|
|
|
|
.BR ENOBUFS ", " ENOMEM
|
|
|
|
Not enough free memory.
|
|
|
|
This often means that the memory allocation is limited by the socket
|
2008-11-22 03:02:45 +00:00
|
|
|
buffer limits, not by the system memory, but this is not 100% consistent.
|
2008-08-08 16:41:48 +00:00
|
|
|
.TP
|
|
|
|
.B ENOENT
|
|
|
|
.B SIOCGSTAMP
|
|
|
|
was called on a socket where no packet arrived.
|
|
|
|
.TP
|
|
|
|
.B ENOPKG
|
|
|
|
A kernel subsystem was not configured.
|
|
|
|
.TP
|
|
|
|
.BR ENOPROTOOPT " and " EOPNOTSUPP
|
|
|
|
Invalid socket option passed.
|
|
|
|
.TP
|
|
|
|
.B ENOTCONN
|
intro.1, _syscall.2, access.2, arch_prctl.2, cacheflush.2, chown.2, clock_getres.2, clone.2, create_module.2, fcntl.2, flock.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getpriority.2, getrlimit.2, getrusage.2, ioprio_set.2, kexec_load.2, madvise.2, mbind.2, migrate_pages.2, mknod.2, mmap.2, mount.2, move_pages.2, mprotect.2, open.2, pause.2, pciconfig_read.2, perf_event_open.2, prctl.2, ptrace.2, query_module.2, read.2, reboot.2, recv.2, s390_runtime_instr.2, sched_setscheduler.2, select_tut.2, send.2, set_mempolicy.2, setfsgid.2, setfsuid.2, sigaction.2, spu_create.2, spu_run.2, stime.2, swapon.2, syslog.2, timer_create.2, timer_getoverrun.2, times.2, tkill.2, umount.2, unimplemented.2, ustat.2, vm86.2, wait.2, abs.3, aio_read.3, aio_write.3, bsd_signal.3, catgets.3, clearenv.3, cmsg.3, dbopen.3, dirfd.3, dlopen.3, exec.3, fenv.3, ferror.3, fmemopen.3, fnmatch.3, fopen.3, futimes.3, getaddrinfo.3, getifaddrs.3, getipnodebyname.3, hsearch.3, if_nameindex.3, inet_pton.3, mblen.3, mbrlen.3, mbsrtowcs.3, mbtowc.3, mcheck.3, memfrob.3, mq_notify.3, netlink.3, posix_memalign.3, printf.3, pthread_attr_setscope.3, pthread_cleanup_push.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, raise.3, resolver.3, rpc.3, rtime.3, rtnetlink.3, scanf.3, setbuf.3, setnetgrent.3, shm_open.3, sigpause.3, sigset.3, sigwait.3, sockatmark.3, strcasecmp.3, strcmp.3, strdup.3, strftime.3, strptime.3, strsignal.3, strverscmp.3, sysv_signal.3, termios.3, wcrtomb.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wctomb.3, wprintf.3, console_codes.4, cpuid.4, msr.4, rtc.4, sk98lin.4, st.4, tty.4, charmap.5, core.5, elf.5, hosts.equiv.5, proc.5, resolv.conf.5, services.5, slabinfo.5, arp.7, bootparam.7, capabilities.7, charsets.7, cpuset.7, ddp.7, epoll.7, feature_test_macros.7, futex.7, hier.7, icmp.7, inotify.7, ip.7, ipv6.7, man-pages.7, mdoc.7, mdoc.samples.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, posixoptions.7, pthreads.7, raw.7, rtld-audit.7, rtnetlink.7, sem_overview.7, sigevent.7, socket.7, spufs.7, tcp.7, udp.7, unicode.7, uri.7, utf-8.7, intro.8, ldconfig.8, sync.8: Global fix: fix placement of word "only"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-31 08:53:00 +00:00
|
|
|
The operation is defined only on a connected socket, but the socket wasn't
|
2008-08-08 16:41:48 +00:00
|
|
|
connected.
|
|
|
|
.TP
|
|
|
|
.B EPERM
|
|
|
|
User doesn't have permission to set high priority, change configuration,
|
|
|
|
or send signals to the requested process or group.
|
|
|
|
.TP
|
|
|
|
.B EPIPE
|
|
|
|
The connection was unexpectedly closed or shut down by the other end.
|
|
|
|
.TP
|
|
|
|
.B ESOCKTNOSUPPORT
|
|
|
|
The socket is not configured or an unknown socket type was requested.
|
|
|
|
.PP
|
|
|
|
Other errors may be generated by the overlaying protocols; see
|
|
|
|
.BR tcp (7),
|
|
|
|
.BR raw (7),
|
getrlimit.2, mmap.2, stat.2, unimplemented.2, dbopen.3, ecvt_r.3, fopen.3, fts.3, getcontext.3, qecvt.3, ip.7, ld.so.8: grfix: Add Oxford comma
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-09-01 15:57:07 +00:00
|
|
|
.BR udp (7),
|
2008-08-08 16:41:48 +00:00
|
|
|
and
|
|
|
|
.BR socket (7).
|
2008-11-24 16:35:02 +00:00
|
|
|
.SH NOTES
|
2010-10-13 04:28:58 +00:00
|
|
|
.BR IP_FREEBIND ,
|
2013-02-10 02:44:05 +00:00
|
|
|
.BR IP_MSFILTER ,
|
2008-08-08 16:41:48 +00:00
|
|
|
.BR IP_MTU ,
|
|
|
|
.BR IP_MTU_DISCOVER ,
|
2010-10-13 05:16:28 +00:00
|
|
|
.BR IP_RECVORIGDSTADDR ,
|
2020-09-17 17:31:43 +00:00
|
|
|
.BR IP_PASSSEC ,
|
2008-08-08 16:41:48 +00:00
|
|
|
.BR IP_PKTINFO ,
|
2010-10-13 04:52:59 +00:00
|
|
|
.BR IP_RECVERR ,
|
|
|
|
.BR IP_ROUTER_ALERT ,
|
2008-08-08 16:41:48 +00:00
|
|
|
and
|
2010-10-13 04:52:59 +00:00
|
|
|
.BR IP_TRANSPARENT
|
2010-10-13 04:41:08 +00:00
|
|
|
are Linux-specific.
|
2008-11-24 16:35:02 +00:00
|
|
|
.\" IP_XFRM_POLICY is Linux-specific
|
accept.2, execve.2, futimesat.2, getresuid.2, getrlimit.2, madvise.2, mq_getsetattr.2, msgctl.2, nice.2, open.2, poll.2, setresuid.2, shmctl.2, sigaction.2, times.2, utimensat.2, __setfpucw.3, atoi.3, endian.3, err.3, euidaccess.3, fenv.3, fopencookie.3, fpurge.3, getgrouplist.3, getutmp.3, j0.3, lgamma.3, netlink.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_cleanup_push_defer_np.3, pthread_getattr_np.3, pthread_kill_other_threads_np.3, pthread_setaffinity_np.3, pthread_tryjoin_np.3, pthread_yield.3, random_r.3, readdir.3, rtnetlink.3, scanf.3, setenv.3, significand.3, sigsetops.3, strerror.3, strstr.3, sysv_signal.3, termios.3, timegm.3, unlocked_stdio.3, y0.3, locale.5, bootparam.7, feature_test_macros.7, ip.7, locale.7, pthreads.7, rtld-audit.7, nscd.8: Global fix: s/non-standard/nonstandard/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:37:52 +00:00
|
|
|
.\" IP_IPSEC_POLICY is a nonstandard extension, also present on some BSDs
|
environ.7, epoll.7, feature_test_macros.7, futex.7, ip.7, ipv6.7, locale.7, man-pages.7, man.7, math_error.7, netdevice.7, netlink.7, packet.7, raw.7, rtld-audit.7, rtnetlink.7, sock_diag.7, socket.7, tcp.7, udp.7, udplite.7, unix.7, uri.7, vdso.7: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 01:01:48 +00:00
|
|
|
.PP
|
2008-08-08 16:41:48 +00:00
|
|
|
Be very careful with the
|
|
|
|
.B SO_BROADCAST
|
|
|
|
option \- it is not privileged in Linux.
|
|
|
|
It is easy to overload the network
|
|
|
|
with careless broadcasts.
|
|
|
|
For new application protocols
|
|
|
|
it is better to use a multicast group instead of broadcasting.
|
|
|
|
Broadcasting is discouraged.
|
|
|
|
.PP
|
|
|
|
Some other BSD sockets implementations provide
|
|
|
|
.B IP_RCVDSTADDR
|
|
|
|
and
|
|
|
|
.B IP_RECVIF
|
|
|
|
socket options to get the destination address and the interface of
|
|
|
|
received datagrams.
|
|
|
|
Linux has the more general
|
|
|
|
.B IP_PKTINFO
|
|
|
|
for the same task.
|
|
|
|
.PP
|
|
|
|
Some BSD sockets implementations also provide an
|
|
|
|
.B IP_RECVTTL
|
|
|
|
option, but an ancillary message with type
|
|
|
|
.B IP_RECVTTL
|
|
|
|
is passed with the incoming packet.
|
|
|
|
This is different from the
|
|
|
|
.B IP_TTL
|
|
|
|
option used in Linux.
|
|
|
|
.PP
|
2016-08-23 06:26:12 +00:00
|
|
|
Using the
|
2008-08-08 16:41:48 +00:00
|
|
|
.B SOL_IP
|
2016-08-23 06:26:12 +00:00
|
|
|
socket options level isn't portable; BSD-based stacks use the
|
2008-08-08 16:41:48 +00:00
|
|
|
.B IPPROTO_IP
|
|
|
|
level.
|
2017-12-14 21:18:20 +00:00
|
|
|
.PP
|
|
|
|
.B INADDR_ANY
|
|
|
|
(0.0.0.0) and
|
|
|
|
.B INADDR_BROADCAST
|
2017-12-18 16:43:54 +00:00
|
|
|
(255.255.255.255) are byte-order-neutral.
|
|
|
|
This means
|
2017-12-14 21:18:20 +00:00
|
|
|
.BR htonl (3)
|
|
|
|
has no effect on them.
|
2008-08-08 16:41:48 +00:00
|
|
|
.SS Compatibility
|
|
|
|
For compatibility with Linux 2.0, the obsolete
|
2008-08-08 16:47:53 +00:00
|
|
|
.BI "socket(AF_INET, SOCK_PACKET, " protocol )
|
2008-08-08 16:41:48 +00:00
|
|
|
syntax is still supported to open a
|
|
|
|
.BR packet (7)
|
|
|
|
socket.
|
|
|
|
This is deprecated and should be replaced by
|
2008-08-08 16:47:53 +00:00
|
|
|
.BI "socket(AF_PACKET, SOCK_RAW, " protocol )
|
2008-08-08 16:41:48 +00:00
|
|
|
instead.
|
|
|
|
The main difference is the new
|
|
|
|
.I sockaddr_ll
|
|
|
|
address structure for generic link layer information instead of the old
|
|
|
|
.BR sockaddr_pkt .
|
|
|
|
.SH BUGS
|
|
|
|
There are too many inconsistent error values.
|
|
|
|
.PP
|
2014-04-26 12:05:35 +00:00
|
|
|
The error used to diagnose exhaustion of the ephemeral port range differs
|
|
|
|
across the various system calls
|
|
|
|
.RB ( connect (2),
|
|
|
|
.BR bind (2),
|
|
|
|
.BR listen (2),
|
|
|
|
.BR sendto (2))
|
|
|
|
that can assign ephemeral ports.
|
|
|
|
.PP
|
2008-08-08 16:41:48 +00:00
|
|
|
The ioctls to configure IP-specific interface options and ARP tables are
|
|
|
|
not described.
|
2014-04-26 10:22:10 +00:00
|
|
|
.\" .PP
|
|
|
|
.\" Some versions of glibc forget to declare
|
|
|
|
.\" .IR in_pktinfo .
|
|
|
|
.\" Workaround currently is to copy it into your program from this man page.
|
2008-08-08 16:41:48 +00:00
|
|
|
.PP
|
|
|
|
Receiving the original destination address with
|
|
|
|
.B MSG_ERRQUEUE
|
|
|
|
in
|
|
|
|
.I msg_name
|
|
|
|
by
|
|
|
|
.BR recvmsg (2)
|
|
|
|
does not work in some 2.2 kernels.
|
|
|
|
.\" .SH AUTHORS
|
|
|
|
.\" This man page was written by Andi Kleen.
|
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex.2, alarm.2, alloc_hugepages.2, arch_prctl.2, bdflush.2, bind.2, brk.2, cacheflush.2, capget.2, chdir.2, chmod.2, chown.2, chroot.2, clock_getres.2, clock_nanosleep.2, clone.2, close.2, connect.2, create_module.2, delete_module.2, dup.2, epoll_create.2, epoll_ctl.2, epoll_wait.2, eventfd.2, execve.2, exit_group.2, faccessat.2, fchmodat.2, fchownat.2, fcntl.2, flock.2, fork.2, fstatat.2, fsync.2, futex.2, futimesat.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getdents.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getitimer.2, getpagesize.2, getpeername.2, getpid.2, getpriority.2, getresuid.2, getrlimit.2, getrusage.2, getsid.2, getsockname.2, getsockopt.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, getxattr.2, idle.2, init_module.2, inotify_add_watch.2, inotify_init.2, inotify_rm_watch.2, intro.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioctl.2, ioctl_list.2, ioperm.2, iopl.2, ioprio_set.2, ipc.2, kcmp.2, kill.2, killpg.2, link.2, linkat.2, listen.2, listxattr.2, llseek.2, lookup_dcookie.2, lseek.2, madvise.2, migrate_pages.2, mincore.2, mkdir.2, mkdirat.2, mknod.2, mknodat.2, mlock.2, mmap.2, mmap2.2, modify_ldt.2, mount.2, move_pages.2, mprotect.2, mq_getsetattr.2, mremap.2, msgctl.2, msgget.2, msgop.2, msync.2, nanosleep.2, nfsservctl.2, nice.2, open.2, openat.2, outb.2, pause.2, pciconfig_read.2, perf_event_open.2, perfmonctl.2, personality.2, pipe.2, pivot_root.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, read.2, readahead.2, readdir.2, readlink.2, readlinkat.2, readv.2, reboot.2, recv.2, remap_file_pages.2, removexattr.2, rename.2, renameat.2, rmdir.2, rt_sigqueueinfo.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, select.2, semctl.2, semget.2, semop.2, send.2, sendfile.2, set_thread_area.2, set_tid_address.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setpgid.2, setresuid.2, setreuid.2, setsid.2, setuid.2, setup.2, setxattr.2, shmctl.2, shmget.2, shmop.2, shutdown.2, sigaction.2, sigaltstack.2, signal.2, signalfd.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, socket.2, socketcall.2, socketpair.2, splice.2, stat.2, statfs.2, stime.2, swapon.2, symlink.2, symlinkat.2, sync.2, sync_file_range.2, sysctl.2, sysfs.2, sysinfo.2, syslog.2, tee.2, time.2, timerfd_create.2, times.2, tkill.2, truncate.2, umask.2, umount.2, uname.2, unimplemented.2, unlink.2, unlinkat.2, uselib.2, ustat.2, utime.2, utimensat.2, vfork.2, vhangup.2, vm86.2, vmsplice.2, wait.2, wait4.2, write.2, CPU_SET.3, INFINITY.3, MB_CUR_MAX.3, MB_LEN_MAX.3, __setfpucw.3, a64l.3, abort.3, abs.3, acos.3, acosh.3, addseverity.3, adjtime.3, aio_cancel.3, aio_error.3, aio_fsync.3, aio_read.3, aio_return.3, aio_suspend.3, aio_write.3, alloca.3, argz_add.3, asin.3, asinh.3, asprintf.3, assert.3, assert_perror.3, atan.3, atan2.3, atanh.3, atexit.3, atof.3, atoi.3, backtrace.3, basename.3, bcmp.3, bcopy.3, bindresvport.3, bsd_signal.3, bsearch.3, bstring.3, btowc.3, btree.3, byteorder.3, bzero.3, cabs.3, cacos.3, cacosh.3, canonicalize_file_name.3, carg.3, casin.3, casinh.3, catan.3, catanh.3, catgets.3, catopen.3, cbrt.3, ccos.3, ccosh.3, ceil.3, cerf.3, cexp.3, cexp2.3, cfree.3, cimag.3, clearenv.3, clock.3, clock_getcpuclockid.3, clog.3, clog10.3, clog2.3, closedir.3, cmsg.3, confstr.3, conj.3, copysign.3, cos.3, cosh.3, cpow.3, cproj.3, creal.3, crypt.3, csin.3, csinh.3, csqrt.3, ctan.3, ctanh.3, ctermid.3, ctime.3, daemon.3, dbopen.3, des_crypt.3, difftime.3, dirfd.3, div.3, dl_iterate_phdr.3, dlopen.3, dprintf.3, drand48.3, drand48_r.3, dysize.3, ecvt.3, ecvt_r.3, encrypt.3, end.3, endian.3, envz_add.3, erf.3, erfc.3, err.3, errno.3, error.3, ether_aton.3, euidaccess.3, exec.3, exit.3, exp.3, exp10.3, exp2.3, expm1.3, fabs.3, fclose.3, fcloseall.3, fdim.3, fenv.3, ferror.3, fexecve.3, fflush.3, ffs.3, fgetgrent.3, fgetpwent.3, fgetwc.3, fgetws.3, finite.3, flockfile.3, floor.3, fma.3, fmax.3, fmemopen.3, fmin.3, fmod.3, fmtmsg.3, fnmatch.3, fopen.3, fpathconf.3, fpclassify.3, fpurge.3, fputwc.3, fputws.3, fread.3, frexp.3, fseek.3, fseeko.3, ftime.3, ftok.3, fts.3, ftw.3, futimes.3, fwide.3, gamma.3, gcvt.3, getaddrinfo.3, getaddrinfo_a.3, getauxval.3, getcontext.3, getcwd.3, getdate.3, getdirentries.3, getdtablesize.3, getenv.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getipnodebyname.3, getline.3, getloadavg.3, getlogin.3, getmntent.3, getnameinfo.3, getnetent.3, getnetent_r.3, getopt.3, getpass.3, getprotoent.3, getprotoent_r.3, getpt.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getrpcent_r.3, getrpcport.3, gets.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, getumask.3, getusershell.3, getutent.3, getw.3, getwchar.3, glob.3, grantpt.3, gsignal.3, hash.3, hsearch.3, hypot.3, iconv.3, iconv_close.3, iconv_open.3, ilogb.3, index.3, inet.3, inet_ntop.3, inet_pton.3, infnan.3, initgroups.3, insque.3, intro.3, isalpha.3, isatty.3, isgreater.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, j0.3, key_setsecret.3, ldexp.3, lgamma.3, lio_listio.3, localeconv.3, lockf.3, log.3, log10.3, log1p.3, log2.3, logb.3, login.3, longjmp.3, lrint.3, lround.3, lsearch.3, lseek64.3, makecontext.3, makedev.3, malloc.3, malloc_hook.3, mblen.3, mbrlen.3, mbrtowc.3, mbsinit.3, mbsnrtowcs.3, mbsrtowcs.3, mbstowcs.3, mbtowc.3, memccpy.3, memchr.3, memcmp.3, memcpy.3, memfrob.3, memmem.3, memmove.3, mempcpy.3, memset.3, mkdtemp.3, mkfifo.3, mkfifoat.3, mkstemp.3, mktemp.3, modf.3, mpool.3, mq_close.3, mq_getattr.3, mq_notify.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, mtrace.3, nan.3, netlink.3, nextafter.3, nl_langinfo.3, offsetof.3, on_exit.3, opendir.3, openpty.3, perror.3, popen.3, posix_fallocate.3, posix_memalign.3, posix_openpt.3, pow.3, pow10.3, printf.3, profil.3, program_invocation_name.3, psignal.3, pthread_kill_other_threads_np.3, ptsname.3, putenv.3, putgrent.3, putpwent.3, puts.3, putwchar.3, qecvt.3, qsort.3, queue.3, raise.3, rand.3, random.3, random_r.3, rcmd.3, re_comp.3, readdir.3, realpath.3, recno.3, regex.3, remainder.3, remove.3, remquo.3, resolver.3, rewinddir.3, rexec.3, rint.3, round.3, rpc.3, rpmatch.3, rtime.3, rtnetlink.3, scalb.3, scalbln.3, scandir.3, scandirat.3, scanf.3, seekdir.3, sem_close.3, sem_destroy.3, sem_getvalue.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sem_wait.3, setaliasent.3, setbuf.3, setenv.3, setjmp.3, setlocale.3, setlogmask.3, setnetgrent.3, shm_open.3, siginterrupt.3, signbit.3, significand.3, sigpause.3, sigqueue.3, sigset.3, sigsetops.3, sigvec.3, sin.3, sincos.3, sinh.3, sleep.3, sockatmark.3, sqrt.3, statvfs.3, stdarg.3, stdin.3, stdio.3, stdio_ext.3, stpcpy.3, stpncpy.3, strcasecmp.3, strcat.3, strchr.3, strcmp.3, strcoll.3, strcpy.3, strdup.3, strerror.3, strfmon.3, strfry.3, strftime.3, string.3, strlen.3, strnlen.3, strpbrk.3, strptime.3, strsep.3, strsignal.3, strspn.3, strstr.3, strtod.3, strtoimax.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, strxfrm.3, swab.3, sysconf.3, syslog.3, system.3, sysv_signal.3, tan.3, tanh.3, tcgetpgrp.3, tcgetsid.3, telldir.3, tempnam.3, termios.3, tgamma.3, timegm.3, timeradd.3, tmpfile.3, tmpnam.3, toascii.3, toupper.3, towctrans.3, towlower.3, towupper.3, trunc.3, tsearch.3, ttyname.3, ttyslot.3, tzset.3, ualarm.3, ulimit.3, ungetwc.3, unlocked_stdio.3, unlockpt.3, updwtmp.3, usleep.3, wcpcpy.3, wcpncpy.3, wcrtomb.3, wcscasecmp.3, wcscat.3, wcschr.3, wcscmp.3, wcscpy.3, wcscspn.3, wcsdup.3, wcslen.3, wcsncasecmp.3, wcsncat.3, wcsncmp.3, wcsncpy.3, wcsnlen.3, wcsnrtombs.3, wcspbrk.3, wcsrchr.3, wcsrtombs.3, wcsspn.3, wcsstr.3, wcstoimax.3, wcstok.3, wcstombs.3, wcswidth.3, wctob.3, wctomb.3, wctrans.3, wctype.3, wcwidth.3, wmemchr.3, wmemcmp.3, wmemcpy.3, wmemmove.3, wmemset.3, wordexp.3, wprintf.3, xcrypt.3, xdr.3, y0.3, cciss.4, console.4, console_codes.4, console_ioctl.4, dsp56k.4, fd.4, full.4, hd.4, hpsa.4, initrd.4, intro.4, lp.4, mem.4, mouse.4, null.4, pts.4, ram.4, random.4, rtc.4, sk98lin.4, st.4, tty.4, ttyS.4, tty_ioctl.4, vcs.4, wavelan.4, acct.5, charmap.5, dir_colors.5, filesystems.5, ftpusers.5, group.5, host.conf.5, hosts.5, hosts.equiv.5, intro.5, issue.5, locale.5, motd.5, networks.5, nologin.5, nscd.conf.5, passwd.5, proc.5, protocols.5, resolv.conf.5, rpc.5, securetty.5, services.5, shells.5, termcap.5, ttytype.5, utmp.5, armscii-8.7, arp.7, ascii.7, bootparam.7, capabilities.7, charsets.7, complex.7, cp1251.7, credentials.7, ddp.7, environ.7, epoll.7, fifo.7, futex.7, glob.7, hier.7, icmp.7, inotify.7, intro.7, ip.7, ipv6.7, iso_8859-1.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-16.7, iso_8859-2.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-8.7, iso_8859-9.7, koi8-r.7, koi8-u.7, locale.7, mailaddr.7, man.7, mq_overview.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, pipe.7, posixoptions.7, pthreads.7, pty.7, raw.7, regex.7, rtld-audit.7, rtnetlink.7, sem_overview.7, shm_overview.7, sigevent.7, signal.7, socket.7, standards.7, suffixes.7, svipc.7, tcp.7, termio.7, time.7, udp.7, udplite.7, unicode.7, unix.7, uri.7, utf-8.7, x25.7, nscd.8, sync.8, tzselect.8, zdump.8, zic.8: Global fix: remove unneeded double quotes in .SH headings
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-02-24 18:01:36 +00:00
|
|
|
.SH SEE ALSO
|
2008-08-08 16:41:48 +00:00
|
|
|
.BR recvmsg (2),
|
|
|
|
.BR sendmsg (2),
|
|
|
|
.BR byteorder (3),
|
|
|
|
.BR capabilities (7),
|
2012-10-10 09:10:45 +00:00
|
|
|
.BR icmp (7),
|
2012-10-10 09:10:05 +00:00
|
|
|
.BR ipv6 (7),
|
2020-04-23 11:48:37 +00:00
|
|
|
.BR netdevice (7),
|
2008-08-08 16:41:48 +00:00
|
|
|
.BR netlink (7),
|
|
|
|
.BR raw (7),
|
|
|
|
.BR socket (7),
|
|
|
|
.BR tcp (7),
|
2017-03-02 13:39:37 +00:00
|
|
|
.BR udp (7),
|
|
|
|
.BR ip (8)
|
2008-08-08 16:41:48 +00:00
|
|
|
.PP
|
2020-04-06 08:42:03 +00:00
|
|
|
The kernel source file
|
|
|
|
.IR Documentation/networking/ip-sysctl.txt .
|
|
|
|
.PP
|
2008-08-08 16:41:48 +00:00
|
|
|
RFC\ 791 for the original IP specification.
|
|
|
|
RFC\ 1122 for the IPv4 host requirements.
|
|
|
|
RFC\ 1812 for the IPv4 router requirements.
|