Skip to content

Commit a10e413

Browse files
authored
Add missing ETH_P_ALL identifier to socket (#11876)
1 parent 37f9e4c commit a10e413

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

stdlib/socket.pyi

+13
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,13 @@ if sys.version_info >= (3, 12):
474474
ETHERTYPE_VLAN as ETHERTYPE_VLAN,
475475
)
476476

477+
if sys.platform == "linux":
478+
from _socket import ETH_P_ALL as ETH_P_ALL
479+
480+
if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin":
481+
# FreeBSD >= 14.0
482+
from _socket import PF_DIVERT as PF_DIVERT
483+
477484
# Re-exported from errno
478485
EBADF: int
479486
EAGAIN: int
@@ -525,6 +532,9 @@ class AddressFamily(IntEnum):
525532
AF_BLUETOOTH = 32
526533
if sys.platform == "win32" and sys.version_info >= (3, 12):
527534
AF_HYPERV = 34
535+
if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin" and sys.version_info >= (3, 12):
536+
# FreeBSD >= 14.0
537+
AF_DIVERT = 44
528538

529539
AF_INET = AddressFamily.AF_INET
530540
AF_INET6 = AddressFamily.AF_INET6
@@ -577,6 +587,9 @@ if sys.platform != "win32" or sys.version_info >= (3, 9):
577587

578588
if sys.platform == "win32" and sys.version_info >= (3, 12):
579589
AF_HYPERV = AddressFamily.AF_HYPERV
590+
if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin" and sys.version_info >= (3, 12):
591+
# FreeBSD >= 14.0
592+
AF_DIVERT = AddressFamily.AF_DIVERT
580593

581594
class SocketKind(IntEnum):
582595
SOCK_STREAM = 1

0 commit comments

Comments
 (0)