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

No such device (os error 19) #263

Closed
jlopezr opened this issue Feb 10, 2023 · 11 comments
Closed

No such device (os error 19) #263

jlopezr opened this issue Feb 10, 2023 · 11 comments

Comments

@jlopezr
Copy link

jlopezr commented Feb 10, 2023

Hi!

I am having problems with bandwhich compiled by myself.

sudo ./bandwhich
Error:

 lo: No such device (os error 19)
 ens3: No such device (os error 19)
 docker0: No such device (os error 19)
 br-a352cf46e04d: No such device (os error 19)
 veth1792dd0: No such device (os error 19)
 veth84d80b4: No such device (os error 19)

On the other hand, the binary version available on github is working perfectly. The same error happens in Linux x64 and Linux armv7 that I crosscompiled.

@brooksvb
Copy link

brooksvb commented Mar 9, 2023

Same issue here upon installing with cargo.

On Manjaro 5.15

@gruvw
Copy link

gruvw commented Apr 1, 2023

Same issue here, also installed with cargo on Ubuntu 22.04LTS.

@jcgruenhage
Copy link
Contributor

I've run into this while fixing the build on Void Linux. The old binary from our repos still works just fine, the new one doesn't. The only things that changed between then:

  • Rust was updated a few times, going from 1.46.0 to 1.68.2
  • I updated the socket2 library, because it wouldn't build on Rust 1.64+ otherwise

I've got https://pastebin.com/A8bJuafj and https://pastebin.com/aKLfRb9Z, which are strace logs from both of the binaries. The first one is the broken one, the second is the older, working binary.

The critical bit seems to be the setsockopt syscall, which is the one that fails, that is being called with slightly different parameters now:

diff --git a/old b/new
index 479c50e..69c3a0f 100644
--- a/old
+++ b/new
@@ -1 +1 @@
-setsockopt(3, SOL_PACKET, PACKET_ADD_MEMBERSHIP, {mr_ifindex=if_nametoindex("lo"), mr_type=PACKET_MR_PROMISC, mr_alen=0, mr_address=ff:ff:ff:ff:ff:ff}, 16) = 0
+setsockopt(3, SOL_PACKET, PACKET_ADD_MEMBERSHIP, {mr_ifindex=0, mr_type=PACKET_MR_MULTICAST, mr_alen=0, mr_address=ff:ff:ff:ff:ff:ff}, 16) = -1 ENODEV (No such device)

I haven't gotten any further yet, but maybe this motivates someone else to take a deeper look here :)

@Alcaro
Copy link

Alcaro commented Apr 10, 2023

Sounds like rust-lang/rust#78802 to me

@jcgruenhage
Copy link
Contributor

That's the build issue resolved by updating socket2, but apparently there's more libraries in bandwhich's dependency tree that relied on this behaviour: mio relied on that behaviour prior to version 0.7.6 as well. mio is in the dependency tree twice, once in version 0.6.21, brought in by [email protected], and once in version 0.7.0 brought in by crossterm. I think the big task here is migrating tokio to the stable release, bringing up mio as well. Whether that's actually related though, I'm not sure. No such device sounds like a different problem to me.

@jcgruenhage
Copy link
Contributor

I'll be opening a PR later with the dependencies upgraded, but I can already report some success: With pnet ugpraded, it works again.

@denis3509
Copy link

same on ubuntu 23.04

@stappersg
Copy link

After doing

git remote add jcgruenhage https://github.com/jcgruenhage/bandwhich
git fetch jcgruenhage
git checkout upgrades-2023-04-11

I was able to do

cargo build

succesfully.

@hayden-pan
Copy link

I have try downgrade rust version to 1.62.1 and rebuild, bandwhich run succesfully.

@jwbowen
Copy link

jwbowen commented Aug 15, 2023

Is this project still active?

@cyqsimon
Copy link
Collaborator

This should be fixed in #273. See also #275.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants