We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ae46b7 commit 93c9472Copy full SHA for 93c9472
scapy/arch/linux/rtnetlink.py
@@ -887,6 +887,9 @@ def read_routes():
887
ifaces = _get_if_list()
888
results = _read_routes(socket.AF_INET)
889
for msg in results:
890
+ # Omit stupid answers (some OS conf appears to lead to this)
891
+ if msg.rtm_family != socket.AF_INET:
892
+ continue
893
# Process the RTM_NEWROUTE
894
net = 0
895
mask = itom(msg.rtm_dst_len)
@@ -937,6 +940,9 @@ def read_routes6():
937
940
results = _read_routes(socket.AF_INET6)
938
941
lifaddr = _get_ips(af_family=socket.AF_INET6)
939
942
943
944
+ if msg.rtm_family != socket.AF_INET6:
945
946
947
prefix = "::"
948
plen = msg.rtm_dst_len
0 commit comments