-
Notifications
You must be signed in to change notification settings - Fork 191
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
scapy fails to launch when netifaces is installed #22
Comments
Netifaces is optional. Try removing netifaces and trying again. I will check if they introduced some incompatible changes in netifaces. |
Yeah, it works alright without |
netifaces provides OS independent and clean way to determine IP addresses of interfaces. It makes code cleaner, but apparently there have been some changes on the netifaces side as it used to work few months ago. |
While debugging the issue, the error came up at line number 66 in pcapdnet.py. The issue is, looking up of IP address of an invalid interface, BTW, the routes on the machines as fetched by |
When netifaces is available, it overrides get_if_list function and uses netifaces.interfaces(). Please, provide your actual |
❯❯❯ netstat -rn
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 10.0.2.1 UGSc 167 0 en1
default link#11 UCSI 0 0 bridge1
10.0.2/24 link#4 UCS 1 0 en1
10.0.2.1/32 link#4 UCS 2 0 en1
10.0.2.1 24:a2:e1:e6:f8:54 UHLWIir 169 7 en1 913
10.0.2.4 24:a2:e1:e6:f8:54 UHLWI 0 9 en1 1199
10.0.2.8/32 link#4 UCS 0 0 en1
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 1 26 lo0
169.254 link#4 UCS 0 0 en1
192.168.2 link#11 UC 1 0 bridge1
Internet6:
Destination Gateway Flags Netif Expire
::1 ::1 UHL lo0
fde9:2dd0:8e47:d788::/64 fe80::7d36:cd1b:c121:6ace%utun0 Uc utun0
fde9:2dd0:8e47:d788:7d36:cd1b:c121:6ace link#12 UHL lo0
fe80::%lo0/64 fe80::1%lo0 UcI lo0
fe80::1%lo0 link#1 UHLI lo0
fe80::%en1/64 link#4 UCI en1
fe80::26a2:e1ff:fee6:f854%en1 24:a2:e1:e6:f8:54 UHLWI en1
fe80::62f8:1dff:feb8:e72%en1 60:f8:1d:b8:e:72 UHLI lo0
fe80::%awdl0/64 link#9 UCI awdl0
fe80::a866:eaff:feca:cac9%awdl0 aa:66:ea:ca:ca:c9 UHLI lo0
fe80::%bridge100/64 link#11 UCI bridge10
fe80::60f8:1dff:fe8b:9264%bridge100 62.f8.1d.8b.92.64 UHLI lo0
fe80::%utun0/64 fe80::7d36:cd1b:c121:6ace%utun0 UcI utun0
fe80::7d36:cd1b:c121:6ace%utun0 link#12 UHLI lo0
ff01::%lo0/32 ::1 UmCI lo0
ff01::%en1/32 link#4 UmCI en1
ff01::%awdl0/32 link#9 UmCI awdl0
ff01::%bridge100/32 link#11 UmCI bridge10
ff01::%utun0/32 fe80::7d36:cd1b:c121:6ace%utun0 UmCI utun0
ff02::%lo0/32 ::1 UmCI lo0
ff02::%en1/32 link#4 UmCI en1
ff02::%awdl0/32 link#9 UmCI awdl0
ff02::%bridge100/32 link#11 UmCI bridge10
ff02::%utun0/32 fe80::7d36:cd1b:c121:6ace%utun0 UmCI utun0 |
Apparently there are differences between interface names as returned by netstat and netifaces. bridge0 vs. bridge 1, bridge100 vs. bridge10. So, this is likely a bug for netifaces for your specific configuration (or generally for bridged interfaces). |
Output from ❯❯❯ ifconfig| grep mtu | cut -d':' -f1
lo0
gif0
stf0
en1
en0
en2
en3
p2p0
awdl0
bridge0
bridge100
utun0
vboxnet0
vboxnet1
vboxnet2 |
Current assumption is that interface names are consistent with output from |
Yeah, this was an issue of a messed up network configuration with |
I confirm that there is still an issue present. The error is reproducible if you have a VM, created with virtualbox, and start the VM. I understand it's not an ideal solution, but nor is reinstalling the system. I currently use my company's laptop, and it's not like I can reinstall anytime I want. Thank you. |
@ciobania did you try using scapy with netifaces switched off? It is optional package as was written before. |
Yes, and the behaviour is still present. I am using it home on some personal projects as well, and I have no issue on that machine. |
Why do you need netifaces enabled in scapy (especially, as it runs better with it disabled for your case)? conf.use_netifaces disables it for scapy, you can still use netifaces anything else you need in your script. |
Use appropriate config value to call tcpdump
(scapy3k)~ ❯❯❯ scapy
Is
netifaces
package optional? I see, you have stated this on stackoverflow.com. What do you suggest, shouldnetifaces
be installed or not?EDIT: I am running scapy on Mac OS X 10.10.5.
The text was updated successfully, but these errors were encountered: