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

Don't rely on random interfaces order #13

Open
ezbik opened this issue Jun 27, 2021 · 0 comments
Open

Don't rely on random interfaces order #13

ezbik opened this issue Jun 27, 2021 · 0 comments

Comments

@ezbik
Copy link

ezbik commented Jun 27, 2021

      q_num0 = os.listdir("/sys/class/net/").index(opts.interface) * 2
      q_num1 = os.listdir("/sys/class/net/").index(opts.interface) * 2 + 1

Queues numbers are determined based on os.listdir("/sys/class/net/") which returns array elements in random manner.
Yet it badly covers the situation when interfaces appear\disappear from the OS. We may end up at collisions, when running multiple per-interface Osfooler instances.

I believe we should read /sys/class/net/$if_name/ifindex and use the value for calculating Queue numbers, instead of using array element index numbers.

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

No branches or pull requests

1 participant