/[smeserver]/rpms/e-smith-lib/sme9/e-smith-lib-2.4.0-fix_bonding.patch
ViewVC logotype

Annotation of /rpms/e-smith-lib/sme9/e-smith-lib-2.4.0-fix_bonding.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sun Feb 24 15:11:22 2013 UTC (11 years, 3 months ago) by vip-ire
Branch: MAIN
CVS Tags: e-smith-lib-2_4_0-18_el6_sme, e-smith-lib-2_4_0-9_el6_sme, e-smith-lib-2_4_0-11_el6_sme, e-smith-lib-2_4_0-12_el6_sme, e-smith-lib-2_4_0-7_el6_sme, e-smith-lib-2_4_0-4_el6_sme, e-smith-lib-2_4_0-6_el6_sme, e-smith-lib-2_4_0-3_el6_sme, e-smith-lib-2_4_0-17_el6_sme, e-smith-lib-2_4_0-15_el6_sme, e-smith-lib-2_4_0-16_el6_sme, e-smith-lib-2_4_0-13_el6_sme, e-smith-lib-2_4_0-14_el6_sme, e-smith-lib-2_4_0-8_el6_sme, e-smith-lib-2_4_0-5_el6_sme, e-smith-lib-2_4_0-10_el6_sme, HEAD
* Sun Feb 23 2013 Daniel Berteaud <daniel@firewall-services.com> 2.4.0-3.sme
- Fix MAC detection for bond slaves [SME: 3596]

1 vip-ire 1.1 diff -Nur e-smith-lib-2.4.0/root/usr/share/perl5/vendor_perl/esmith/ethernet.pm e-smith-lib-2.4.0-fix_bonding/root/usr/share/perl5/vendor_perl/esmith/ethernet.pm
2     --- e-smith-lib-2.4.0/root/usr/share/perl5/vendor_perl/esmith/ethernet.pm 2013-02-23 18:47:46.441079217 +0100
3     +++ e-smith-lib-2.4.0-fix_bonding/root/usr/share/perl5/vendor_perl/esmith/ethernet.pm 2013-02-23 18:48:57.386558526 +0100
4     @@ -66,8 +66,21 @@
5     # Now we should be left only wth ethernet adapters
6     open HW, "/sys/class/net/$nic/address";
7     my $mac = join("", <HW>);
8     - chomp($mac);
9     close HW;
10     + # If the device is a slave of a bridge, it's real MAC
11     + # address can be found in /proc/net/bonding/bondX
12     + if (-l "/sys/class/net/$nic/master"){
13     + my $bond = basename (readlink "/sys/class/net/$nic/master");
14     + local $/ = '';
15     + open SLAVES, "/proc/net/bonding/$bond";
16     + my @slaves = <SLAVES>;
17     + close SLAVES;
18     + my @slaveInfo = grep { /^Slave\ Interface:\ $nic/m } @slaves;
19     + foreach (split /\n+/, (join "", @slaveInfo)){
20     + $mac = $1 if (/^Permanent\ HW\ addr:\ (.*)$/);
21     + }
22     + }
23     + chomp($mac);
24     my $driver = basename (readlink "/sys/class/net/$nic/device/driver");
25     my $bus = basename (readlink "/sys/class/net/$nic/device/subsystem");
26     my $desc = $nic;

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed