]> git.uio.no Git - check_linux_bonding.git/commitdiff
new path to slaves with kernel >= 3.13
authorTrond Hasle Amundsen <t.h.amundsen@usit.uio.no>
Tue, 13 May 2014 14:14:42 +0000 (16:14 +0200)
committerTrond Hasle Amundsen <t.h.amundsen@usit.uio.no>
Tue, 13 May 2014 14:14:42 +0000 (16:14 +0200)
check_linux_bonding

index 2a95461463338bce08691e536e80bc3246f6f9ed..361df4b43c142a71bdaecbd238757be428112b15 100755 (executable)
@@ -311,8 +311,11 @@ sub find_bonding_sysfs {
 
        # get slave status
        foreach my $slave (@slaves) {
-           open my $STATE, '<', "$sysdir/$bond/slave_$slave/operstate"
-             or unknown_error("Couldn't open $sysdir/$bond/slave_$slave/operstate: $!");
+           my $statefile = -e "$sysdir/$bond/slave_$slave/operstate"
+             ? "$sysdir/$bond/slave_$slave/operstate"
+               : "$sysdir/$bond/lower_$slave/operstate";
+           open my $STATE, '<', "$statefile"
+             or unknown_error("Couldn't open $statefile: $!");
            chop($bonding{$bond}{slave}{$slave} = <$STATE>);
            close $STATE;
        }