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

Buggy /usr/share/laptop-mode-tools/modules/ethernet? #171

Open
kamil4 opened this issue Sep 21, 2021 · 0 comments
Open

Buggy /usr/share/laptop-mode-tools/modules/ethernet? #171

kamil4 opened this issue Sep 21, 2021 · 0 comments

Comments

@kamil4
Copy link

kamil4 commented Sep 21, 2021

I believe I spotted a bug in version 1.74 in /usr/share/laptop-mode-tools/modules/ethernet.

speed=`$MIITOOL -v $DEVICE 2>/dev/null | grep capabilities | tr ' ' '\n' |\

if $IPTOOL link show $DEVICE | grep -q NO-CARRIER; then

Lines 36 and 64 reference DEVICE, which should not be available outside the loop that only starts in line 104?

for DEVICE in $ETHERNET_DEVICES ; do

Thank you!

wxphaha referenced this issue in wxphaha/laptop-mode-tools Sep 22, 2021
Part of the code uses DEVICE before assigning a value to DEVICE, which will cause the condition to be judged incorrectly.
For example, if there is another network card NO-CARRIER, it will cause eth0 to be erroneously disabled.
Move this part of the code after assigning a value to the DEVICE.
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