Diffstat (limited to 'noncore/settings/networksettings2/network/networkrun.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/networkrun.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp index 2c93d9d..74467ad 100644 --- a/noncore/settings/networksettings2/network/networkrun.cpp +++ b/noncore/settings/networksettings2/network/networkrun.cpp | |||
@@ -1,21 +1,21 @@ | |||
1 | #include <system.h> | 1 | #include <system.h> |
2 | #include <netnode.h> | 2 | #include <netnode.h> |
3 | #include <resources.h> | 3 | #include <resources.h> |
4 | #include "networkrun.h" | 4 | #include "networkrun.h" |
5 | 5 | ||
6 | State_t NetworkRun::detectState( void ) { | 6 | State_t NetworkRun::detectState( void ) { |
7 | InterfaceInfo * II = nodeCollection()->assignedInterface(); | 7 | InterfaceInfo * II = nodeCollection()->assignedInterface(); |
8 | 8 | ||
9 | Log(( "Interface %p : %d\n", II, (II) ? II->IsUp : 0 )); | 9 | Log(( "Interface %p %p : %d\n", II, nodeCollection(), (II) ? II->IsUp : 0 )); |
10 | if( II && II->IsUp ) { | 10 | if( II && II->IsUp ) { |
11 | // device has assigned interface | 11 | // device has assigned interface |
12 | return IsUp; | 12 | return IsUp; |
13 | } | 13 | } |
14 | 14 | ||
15 | // had no interface or interface is no longer up -> release | 15 | // had no interface or interface is no longer up -> release |
16 | nodeCollection()->assignInterface( 0 ); | 16 | nodeCollection()->assignInterface( 0 ); |
17 | 17 | ||
18 | return Unknown; | 18 | return Unknown; |
19 | } | 19 | } |
20 | 20 | ||
21 | QString NetworkRun::setMyState( NodeCollection * NC, Action_t A, bool ) { | 21 | QString NetworkRun::setMyState( NodeCollection * NC, Action_t A, bool ) { |
@@ -29,22 +29,23 @@ QString NetworkRun::setMyState( NodeCollection * NC, Action_t A, bool ) { | |||
29 | 29 | ||
30 | QStringList SL; | 30 | QStringList SL; |
31 | 31 | ||
32 | if( A == Up ) { | 32 | if( A == Up ) { |
33 | // we can bring UP if lower level is available | 33 | // we can bring UP if lower level is available |
34 | SL << "ifup"; | 34 | SL << "ifup"; |
35 | } else if( A == Down ) { | 35 | } else if( A == Down ) { |
36 | SL << "ifdown"; | 36 | SL << "ifdown"; |
37 | } else { | 37 | } else { |
38 | return QString(); | 38 | return QString(); |
39 | } | 39 | } |
40 | 40 | ||
41 | SL << QString().sprintf( "%s=%s-c%d-allowed", | 41 | SL << QString().sprintf( "%s=A%ld%s", |
42 | II->Name.latin1(), II->Name.latin1(), | 42 | II->Name.latin1(), |
43 | nodeCollection()->number() ); | 43 | nodeCollection()->number(), |
44 | II->Name.latin1() ); | ||
44 | 45 | ||
45 | if( ! NSResources->system().runAsRoot( SL ) ) { | 46 | if( ! NSResources->system().runAsRoot( SL ) ) { |
46 | return QString("Cannot call %1").arg(SL.join(" ")); | 47 | return QString("Cannot call %1").arg(SL.join(" ")); |
47 | } | 48 | } |
48 | 49 | ||
49 | return QString(); | 50 | return QString(); |
50 | } | 51 | } |