diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-11-27 23:48:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-27 23:48:59 (GMT) |
commit | 60a08e6ff2ef8306d276a40f861bf46f34ba09bd (patch) | |
tree | 7c16eac143f91533fb71f91864d1e3e0d61f16b1 | |
parent | ee7dc6708142ff0c514c0f6a1d44f785720ab991 (diff) | |
download | cpython-60a08e6ff2ef8306d276a40f861bf46f34ba09bd.zip cpython-60a08e6ff2ef8306d276a40f861bf46f34ba09bd.tar.gz cpython-60a08e6ff2ef8306d276a40f861bf46f34ba09bd.tar.bz2 |
[3.12] Correct documentation for AF_PACKET (GH-112339) (#112477)
Correct documentation for AF_PACKET (GH-112339)
Protocol in the address tuple should *not* be in the network-byte-order, because it is converted internally[1].
[1] https://github.com/python/cpython/blob/89ddea4886942b0c27a778a0ad3f0d5ac5f518f0/Modules/socketmodule.cGH-L2144
network byte order doesn't make sense for a python level int anyways. It's a fixed size C serialization concept.
(cherry picked from commit 562d7149c6944fb9e4c7be80664b2f2d5a12a3ea)
Co-authored-by: Eugene Toder <eltoder@users.noreply.github.com>
-rw-r--r-- | Doc/library/socket.rst | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index e36fc17..e0a7530 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -185,7 +185,7 @@ created. Socket addresses are represented as follows: .. versionadded:: 3.7 - :const:`AF_PACKET` is a low-level interface directly to network devices. - The packets are represented by the tuple + The addresses are represented by the tuple ``(ifname, proto[, pkttype[, hatype[, addr]]])`` where: - *ifname* - String specifying the device name. @@ -193,7 +193,6 @@ created. Socket addresses are represented as follows: May be :data:`ETH_P_ALL` to capture all protocols, one of the :ref:`ETHERTYPE_* constants <socket-ethernet-types>` or any other Ethernet protocol number. - Value must be in network-byte-order. - *pkttype* - Optional integer specifying the packet type: - ``PACKET_HOST`` (the default) - Packet addressed to the local host. |