Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcdafd17

Browse files
committed
Add socket.SO_BINDTOIFINDEX constant
This socket option avoids a race condition between SO_BINDTODEVICE and network interface renaming.
1 parent278030a commitcdafd17

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

‎Doc/library/socket.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ Constants
437437
``TCP_FASTOPEN_KEY``, ``TCP_FASTOPEN_NO_COOKIE``,
438438
``TCP_ZEROCOPY_RECEIVE``, ``TCP_INQ``, ``TCP_TX_DELAY``.
439439
Added ``IP_PKTINFO``.
440+
Added ``SO_BINDTOIFINDEX``. On Linux this constant can be used in the
441+
same way that ``SO_BINDTODEVICE`` is used, but with the index of a
442+
network interface instead of its name.
440443

441444
..data::AF_CAN
442445
PF_CAN
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add:data:`socket.SO_BINDTOIFINDEX` constant.

‎Modules/socketmodule.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7901,6 +7901,9 @@ socket_exec(PyObject *m)
79017901
#ifdefSO_BINDTODEVICE
79027902
ADD_INT_MACRO(m,SO_BINDTODEVICE);
79037903
#endif
7904+
#ifdefSO_BINDTOIFINDEX
7905+
ADD_INT_MACRO(m,SO_BINDTOIFINDEX);
7906+
#endif
79047907
#ifdefSO_PRIORITY
79057908
ADD_INT_MACRO(m,SO_PRIORITY);
79067909
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp