tcpflow does not work in bash
- A brief description
While ifconfig was fixed in latest insider preview, tcpflow still does not work. Trying to run sudo tcpflow -i lo port 20000 shows error:
tcpflow: lo: socket: Invalid argument
-
Expected results it should start to listen tcp traffic on port 20000
-
Actual results (with terminal output if applicable) tcpflow: lo: socket: Invalid argument
-
Your Windows build number version 1607 build 14986.1000
-
Steps / All commands required to reproduce the error from a brand new installation Run bash as administrator, then type:
sudo tcpflow -i lo port 20000 -
Strace of the failing command
socket(PF_PACKET, SOCK_RAW, 768) = -1 EAFNOSUPPORT (Address family not supported by protocol)
socket(PF_INET, SOCK_PACKET, 0x300 /* IPPROTO_??? */) = -1 EINVAL (Invalid argument)
write(2, "tcpflow: ", 9tcpflow: ) = 9
write(2, "lo: socket: Invalid argument", 28lo: socket: Invalid argument) = 28
write(2, "\n", 1
- Required packages and commands to install
tcpflow
See our contributing instructions for assistance.
Does it work on the non-loopback ifaces?
@fpqc it does not work on all interfaces (I tried sudo tcpflow -i eth1 port 20000 and sudo tcpflow -i any port 20000)
This sounds related to @JasonLinMS 's final comment on #1451 , regarding SOCK_RAW support.
@sunilmut Yeah, unfortunately, we don't support SOCK_PACKET yet either.
Why ppl like Linux because Linux has fewer restrictions, people can do more what they want to do. Please don't bring the limit from windows to the WSL.if only can do the windows can do,why we should be use WSL?
Soo,when could be the problem soloved?
https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/17817685-support-af-packet-address-family-tcpdump-wireshar
that has 1426 votes now ? how many votes need ?
More than a year later and still no progress? Seriously, what is it going to take to prioritize supporting AF_PACKET and RAW SOCKETS.
Dunno. I do know what it is going to take to dupe this into #1349 though.
Is there any update to this issue? I'm unable to run any network related programs other than ping or curl really...
Is there still no fix for the missing compatibility with AF_SOCKET etc.?
Is there still no fix for the missing compatibility with AF_SOCKET etc.?
AF_PACKET (and much else) is available in WSL2.


Just a note: for me the reason of trying to use tcpflow in WSL was the ability to launch server in Windows and use tcpflow to capture traffic from Windows. Unfortunately in WSL2 it's still impossible.