Skip to content

Commit 45e9f61

Browse files
author
nightcityblade
committed
gh-100231: Clarify AF_PACKET protocol byte order
1 parent 5afbb60 commit 45e9f61

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Doc/library/socket.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,10 @@ The AF_* and SOCK_* constants are now :class:`AddressFamily` and
586586

587587
.. data:: ETH_P_ALL
588588

589-
:data:`!ETH_P_ALL` can be used in the :class:`~socket.socket`
590-
constructor as *proto* for the :const:`AF_PACKET` family in order to
591-
capture every packet, regardless of protocol.
589+
To capture every packet, regardless of protocol, with an
590+
:const:`AF_PACKET` socket, pass ``htons(ETH_P_ALL)`` as *proto* to the
591+
:class:`~socket.socket` constructor. The call to :func:`htons` converts
592+
the protocol number to network byte order.
592593

593594
For more information, see the :manpage:`packet(7)` manpage.
594595

0 commit comments

Comments
 (0)