Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not fail on linux < 4.12 #4424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scapy/arch/linux/rtnetlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,11 @@ def _sr1_rtrequest(pkt: Packet) -> List[Packet]:
# Configure socket
sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 32768)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 1048576)
sock.setsockopt(SOL_NETLINK, NETLINK_EXT_ACK, 1)
try:
sock.setsockopt(SOL_NETLINK, NETLINK_EXT_ACK, 1) # this is only supported after Linux 4.12
except OSError:
log_loading.warning("Failed to read the routes using RTNETLINK !")
return []
sock.bind((0, 0)) # bind to kernel
sock.setsockopt(SOL_NETLINK, NETLINK_GET_STRICT_CHK, 1)
# Request routes
Expand Down
Loading