| Summary: | No consideration of options (ETHTOOL_OPTS ) for the NIC by the network scripts | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | Franck BOUIJOUX <3abtux> |
| Component: | RPM Packages | Assignee: | Dan Fandrich <dan> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | High | CC: | 3abtux, crox53, dan, eeeemail, mageia, mageia, richard |
| Version: | 2 | Keywords: | Triaged |
| Target Milestone: | Mageia 2 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | has_procedure | ||
| Source RPM: | initscripts-9.34-20.mga2.rpm | CVE: | |
| Status comment: | |||
|
Franck BOUIJOUX
2013-06-26 18:04:57 CEST
CC:
(none) =>
3abtux
Manuel Hiebel
2013-07-03 09:59:06 CEST
Keywords:
(none) =>
Triaged I confirm this bug.
The solution is to rewrite the two calls to "ethtool" at lines 160 and 162 ("/usr/sbin/ethtool" insteed of "/sbin/ethtool")CC:
(none) =>
richard I confirm this bug too! The problem is indeed a wrong path at lines 160 and 162 in the conf file to reach the ethtool binary : /etc/sysconfig/network-functions CC:
(none) =>
crox53 I confirm also that this bug is also present in Mageia3. Priority:
Normal =>
High And is still present in Cauldron ...
claire robinson
2013-07-08 11:11:06 CEST
CC:
(none) =>
mageia Could you please show the output of # ll -d /sbin It should be a symlink to /usr/sbin CC:
(none) =>
eeeemail Indeed on mageia3 : $ cat /etc/version 3 1 cauldron $ ll -d /sbin lrwxrwxrwx 1 root root 8 mai 25 00:30 /sbin -> usr/sbin/ But not on mageia2 $ cat /etc/version 2 4 cauldron $ ls -d /sbin /sbin/ The need of fix is only for mageia2 Version:
3 =>
2 May sound silly but do you have ethtool installed ? $ rpm -q ethtool Mageia 2 had a legacy /sbin directory which was moved, along with /bin & /lib(64), into /usr as part of the /usrmove feature for Mageia 3. https://wiki.mageia.org/en/Feature:UsrMove May not : --------------------------- >> rpm -qil ethtool Name : ethtool Epoch : 1 Version : 3.2 Release : 1.mga2 Architecture: x86_64 Install Date: mer. 12 juin 2013 09:55:51 CEST Group : System/Configuration/Networking Size : 234868 License : GPL Signature : RSA/SHA1, dim. 19 févr. 2012 04:23:11 CET, Key ID b742fa8b80420f66 Source RPM : ethtool-3.2-1.mga2.src.rpm Build Date : dim. 19 févr. 2012 04:22:02 CET Build Host : jonund.mageia.org Relocations : (not relocatable) Packager : luigiwalser <luigiwalser> Vendor : Mageia.Org URL : https://ftp.kernel.org/pub/software/network/ethtool/ Summary : Ethernet settings tool for network cards Description : This utility allows querying and changing of ethernet card settings, such as speed, port, and autonegotiation. /usr/sbin/ethtool /usr/share/doc/ethtool /usr/share/doc/ethtool/AUTHORS /usr/share/doc/ethtool/NEWS /usr/share/man/man8/ethtool.8.xz --------------- >> grep ethtool /etc/sysconfig/network-scripts/network-functions ethtool_set() /sbin/ethtool $opts /sbin/ethtool -s ${REALDEVICE} $opts ----------------- >>ls -ld /sbin/ drwxr-xr-x 2 root root 4096 juil. 9 15:09 /sbin/
Dan Fandrich
2013-07-23 08:48:12 CEST
CC:
(none) =>
dan I've checked in a fix for this to the Mageia 2 branch, but haven't submitted it to the build system. There are a number of other initscripts bugs open right now, and it would be nice to push some of those fixes at the same time.
Here's a QA test case (it assumes eth0 is the Ethernet device in use on the computer under test):
Run this to baseline the Ethernet settings:
ethtool eth0 2>/dev/null |grep Duplex
It should say:
Duplex: Full
If not, the test case isn't going to be valid on this computer. Now run:
sudo sh -c 'echo ETHTOOL_OPTS=\"duplex half\" >> /etc/sysconfig/network-scripts/ifcfg-eth0'
and test the old initscripts by bringing the network device down then back up:
sudo ifdown eth0; sudo ifup eth0
You should see the following error, confirming this bug:
Determining IP information for eth0..../network-functions: line 162: /sbin/ethtool: No such file or directory
The duplex setting won't have changed:
ethtool eth0 2>/dev/null |grep Duplex
will still say:
Duplex: Full
Now, install the fixed RPM and do the above again. The final result should be either:
Duplex: Half
showing that the settings are working, or, if the Ethernet configuration doesn't support half duplex, the result after bringing the network up again will be:
Determining IP information for eth3...Cannot advertise duplex half
done.
Either result is correct and proves the fix works. Undo the changes once the test is complete by running the following:
sudo sh -c 'echo ETHTOOL_OPTS=\"duplex full\" >> /etc/sysconfig/network-scripts/ifcfg-eth0'
sudo ifdown eth0; sudo ifup eth0
sudo sed -i /^ETHTOOL_OPTS/d /etc/sysconfig/network-scripts/ifcfg-eth0Whiteboard:
(none) =>
has_procedure Where is the "fixed RPM" you are speaking about ? I can't see it on "distrib/2/x86_64/media/core/updates_testing/" repository. I very carefully didn't say "fixed RPM", but rather "haven't submitted it to the build system". I wanted to gather a few more initscripts patches that have been languishing first. I think I've now gathered the ones that are ready, but I'll double check first and probably submit a fixed RPM in a day or two. initscripts-9.34-20.1.mga2 is in updates_testing and available to test. The "initscripts-9.34-20.2.mga2" RPM available on "distrib/2/x86_64/media/core/updates" repository resolv this bug. Thanks Dan. Status:
NEW =>
RESOLVED |
Description of problem: When I want to give parameters to the NIC (ETHTOOL_OPTS), these are not taken into account by the ifup and ifdown network scripts. (Ditto for the network startup script). In the function ethtool_set line 153 in the file </etc/sysconfig/network-scripts/network-functions> launching the ethtool command is performed in absolute path /sbin/ethtool whereas the command is present only in /usr/sbin/ethtool. ethtool_set() { oldifs=$IFS; IFS=';'; for opts in $ETHTOOL_OPTS ; do IFS=$oldifs; if [[ "${opts}" =~ [[:space:]]*- ]]; then /sbin/ethtool $opts else /sbin/ethtool -s ${REALDEVICE} $opts fi IFS=';'; done IFS=$oldifs; } Version-Release number of selected component (if applicable): How reproducible: Every time I attempt to add NIC PARAMETERS and use network scripts. Steps to Reproduce: 1.add <ETHTOOL_OPTS="autoneg off speed 100 duplex full"> in /etc/sysconfig/network-scripts/ifcfg-eth0 2. <ifdown eth0> and <ifup eth0> or service network restart 3. see the rejection Note that the ethtool command works with <ethtool -s eth0 autoneg off> or other parameters. Reproducible: Steps to Reproduce: