]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man2const/IP_PKTINFO.2const: Tweak after split
authorAlejandro Colomar <alx@kernel.org>
Mon, 24 Nov 2025 18:20:12 +0000 (19:20 +0100)
committerAlejandro Colomar <alx@kernel.org>
Tue, 25 Nov 2025 00:10:25 +0000 (01:10 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man2const/IP_PKTINFO.2const

index e43270f748af0ebe35857daad23f3a3cd443ff03..9546d68c653284f8fe8ef37a5aeb71050177db07 100644 (file)
@@ -18,72 +18,68 @@ Standard C library
 .BI int\~setsockopt(int\~ sockfd ,\~IPPROTO_IP,\~IP_PKTINFO,
 .BI "               const\~int\~*" enable ,\~sizeof(int));
 .fi
+.P
+.EX
+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 */
+};
+.EE
 .SH DESCRIPTION
-.TP
-.BR IP_PKTINFO " (since Linux 2.2)"
-.\" Precisely: since Linux 2.1.68
 Pass an
 .B IP_PKTINFO
 ancillary message that contains a
 .I pktinfo
 structure that supplies some information about the incoming packet.
 This works only for datagram oriented sockets.
+.P
 The argument is a flag that tells the socket whether the
 .B IP_PKTINFO
 message should be passed or not.
+.P
 The message itself can be sent/retrieved
 only as a control message with a packet using
 .BR recvmsg (2)
 or
 .BR sendmsg (2).
-.IP
-.in +4n
-.EX
-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 */
-};
-.EE
-.in
-.IP
+.P
 When returned by
 .BR recvmsg (2) ,
-.I ipi_ifindex
+.I .ipi_ifindex
 is the unique index of the interface the packet was received on.
-.I ipi_spec_dst
+.I .ipi_spec_dst
 is the preferred source address for replies to the given packet,
 and
-.I ipi_addr
+.I .ipi_addr
 is the destination address in the packet header.
 These addresses are usually the same,
 but can differ for broadcast or multicast packets.
 Depending on the configured routes,
-.I ipi_spec_dst
+.I .ipi_spec_dst
 might belong to a different interface from the one that received the packet.
-.IP
+.P
 If
 .B IP_PKTINFO
 is passed to
 .BR sendmsg (2)
 and
 .\" This field is grossly misnamed
-.I ipi_spec_dst
+.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
+.I .ipi_ifindex
 is not zero,
 the primary local address of the interface specified by the index
 overwrites
-.I ipi_spec_dst
+.I .ipi_spec_dst
 for the routing table lookup.
-.I ipi_addr
+.I .ipi_addr
 is ignored.
-.IP
+.P
 Not supported for
 .B SOCK_STREAM
 sockets.
@@ -95,7 +91,7 @@ See
 See
 .BR ip (7).
 .SH VERSIONS
-Some other BSD sockets implementations provide
+Some BSD sockets implementations provide
 .B IP_RCVDSTADDR
 and
 .B IP_RECVIF
@@ -106,6 +102,9 @@ Linux has the more general
 for the same task.
 .SH STANDARDS
 Linux.
+.SH HISTORY
+Linux 2.2.
+.\" Precisely: since Linux 2.1.68
 .SH SEE ALSO
 .BR IPPROTO_IP (2const),
 .BR setsockopt (2),