Diffstat (limited to 'noncore/settings/networksettings2/network') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/networkrun.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp index 41e1c53..3e24c5f 100644 --- a/noncore/settings/networksettings2/network/networkrun.cpp +++ b/noncore/settings/networksettings2/network/networkrun.cpp @@ -12,8 +12,9 @@ void NetworkRun::detectState( NodeCollection * NC ) { NC->setCurrentState( (( II->IsUp ) ? IsUp : Available) ); return; } + Log(( "%s not ! UP or ava\n", NC->name().latin1() )); // has no interface -> delegate RI->detectState( NC ); } @@ -33,19 +34,30 @@ bool NetworkRun::setState( NodeCollection * NC, Action_t A, bool Force ) { NSResources->system().runAsRoot( S ); } return 1; } else if( A == Down ) { - if( NC->currentState() == IsUp || Force ) { - QString S; - S.sprintf( "ifdown %s=%s-c%d-allowed", - II->Name.latin1(), II->Name.latin1(), - connection()->number() ); - NSResources->system().runAsRoot( S ); + QString S; + if( Force ) { + Log(("Force mode %d\n", Force )); + for( int i = 0; + i < RI->netNode()->nodeClass()->instanceCount(); + i ++ ) { + S.sprintf( "ifdown %s", + RI->netNode()->nodeClass()->genNic( i ).latin1() ); + NSResources->system().runAsRoot( S ); + } + } else { + if( NC->currentState() == IsUp ) { + S.sprintf( "ifdown %s=%s-c%d-allowed", + II->Name.latin1(), II->Name.latin1(), + connection()->number() ); + NSResources->system().runAsRoot( S ); + } } return 1; } // delegate - return RI->setState( NC, A ); + return RI->setState( NC, A, Force ); } bool NetworkRun::canSetState( State_t Curr, Action_t A ) { // we handle UP and DOWN |