summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/network/networkrun.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/network/networkrun.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/network/networkrun.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp
index 8deca14..f34fdbf 100644
--- a/noncore/settings/networksettings2/network/networkrun.cpp
+++ b/noncore/settings/networksettings2/network/networkrun.cpp
@@ -17,35 +17,37 @@ void NetworkRun::detectState( NodeCollection * NC ) {
17} 17}
18 18
19bool NetworkRun::setState( NodeCollection * NC, Action_t A ) { 19bool NetworkRun::setState( NodeCollection * NC, Action_t A ) {
20 // we handle UP and DOWN 20 // we handle UP and DOWN
21 RuntimeInfo * RI = netNode()->nextNode()->runtime(); 21 RuntimeInfo * RI = netNode()->nextNode()->runtime();
22 AsDevice * Next = RI->asDevice(); 22 AsDevice * Next = RI->asDevice();
23 InterfaceInfo * II = Next->assignedInterface(); 23 InterfaceInfo * II = Next->assignedInterface();
24 24
25 if( A == Up ) { 25 if( A == Up ) {
26 // we can bring UP if lower level is available 26 // we can bring UP if lower level is available
27 if( NC->currentState() == Available ) { 27 if( NC->currentState() == Available ) {
28 QString S; 28 QString S;
29 S.sprintf( "ifup %s", II->Name.latin1() ); 29 S.sprintf( "ifup %s=%s-c%d-allowed",
30 II->Name.latin1(), II->Name.latin1(),
31 connection()->number() );
30 NSResources->system().execute( S ); 32 NSResources->system().execute( S );
31 NC->setCurrentState( IsUp );
32 } 33 }
33 return 1; 34 return 1;
34 } else if( A == Down ) { 35 } else if( A == Down ) {
35 if( NC->currentState() == IsUp ) { 36 if( NC->currentState() == IsUp ) {
36 QString S; 37 QString S;
37 S.sprintf( "ifdown %s", II->Name.latin1() ); 38 S.sprintf( "ifdown %s=%s-c%d-allowed",
39 II->Name.latin1(), II->Name.latin1(),
40 connection()->number() );
38 NSResources->system().execute( S ); 41 NSResources->system().execute( S );
39 NC->setCurrentState( Available );
40 } 42 }
41 return 1; 43 return 1;
42 } 44 }
43 // delegate 45 // delegate
44 return RI->setState( NC, A ); 46 return RI->setState( NC, A );
45} 47}
46 48
47bool NetworkRun::canSetState( State_t Curr, Action_t A ) { 49bool NetworkRun::canSetState( State_t Curr, Action_t A ) {
48 // we handle UP and DOWN 50 // we handle UP and DOWN
49 RuntimeInfo * RI = netNode()->nextNode()->runtime(); 51 RuntimeInfo * RI = netNode()->nextNode()->runtime();
50 52
51 if( A == Up ) { 53 if( A == Up ) {