Skip to content

Commit

Permalink
Temporary disable setting of ttl and tos on IPv6 due to #2 and #4
Browse files Browse the repository at this point in the history
  • Loading branch information
dvolodin7 committed Mar 26, 2023
1 parent fa72983 commit 8b7c2bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ To see unreleased changes, please see the [CHANGELOG on the main branch guide](h

### Changed

* Ping's `ttl` and `tos` options are temporary ignored on IPv6
* docs: license.md renamed to LICENSE.md

### Infrastructure
Expand Down
16 changes: 13 additions & 3 deletions src/gufo/ping/ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,18 @@ class Ping(object):
First address for given address family will be used.
ttl: Set outgoing packet's TTL.
Use OS defaults when empty.
tos: Set DSCP/TOS field to outgoing packets.
!!! warning
This option is ignored on IPv6 socket due to
issue [#4](https://github.com/gufolabs/gufo_ping/issues/4)
tos: Set DSCP/TOS/TCLASS field to outgoing packets.
Use OS defaults when empty.
!!! warning
This option is ignored on IPv6 socket due to
issue [#2](https://github.com/gufolabs/gufo_ping/issues/2)
timeout: Default timeout in seconds.
send_buffer_size: Send buffer size.
Use OS defaults when empty.
Expand Down Expand Up @@ -163,8 +173,8 @@ def __get_socket(self: "Ping", address: str) -> PingSocket:
afi=afi,
size=self.__size,
src_addr=self.__src_addr.get(afi),
ttl=self.__ttl,
tos=self.__tos,
ttl=self.__ttl if afi == 4 else None,
tos=self.__tos if afi == 4 else None,
timeout=self.__timeout,
send_buffer_size=self.__send_buffer_size,
recv_buffer_size=self.__recv_buffer_size,
Expand Down

0 comments on commit 8b7c2bc

Please sign in to comment.