summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/lancard/lancardrun.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/lancard/lancardrun.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/lancard/lancardrun.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.cpp b/noncore/settings/networksettings2/lancard/lancardrun.cpp
index 951756d..2e4fc43 100644
--- a/noncore/settings/networksettings2/lancard/lancardrun.cpp
+++ b/noncore/settings/networksettings2/lancard/lancardrun.cpp
@@ -2,2 +2,3 @@
2#include <qtextstream.h> 2#include <qtextstream.h>
3#include <qstringlist.h>
3#include <resources.h> 4#include <resources.h>
@@ -55,4 +56,8 @@ void LanCardRun::detectState( NodeCollection * NC ) {
55 Run = It.current(); 56 Run = It.current();
56 if( handlesInterface( Run->Name ) && 57 if( handlesInterface( *Run ) &&
57 Run->CardType == ARPHRD_ETHER && 58 ( Run->CardType == ARPHRD_ETHER
59#ifdef ARPHRD_IEEE1394
60 || Run->CardType == ARPHRD_IEEE1394
61#endif
62 ) &&
58 ! Run->IsUp 63 ! Run->IsUp
@@ -147,4 +152,8 @@ InterfaceInfo * LanCardRun::getInterface( void ) {
147 Run = It.current(); 152 Run = It.current();
148 if( handlesInterface( Run->Name ) && 153 if( handlesInterface( *Run ) &&
149 Run->CardType == ARPHRD_ETHER 154 ( Run->CardType == ARPHRD_ETHER
155#ifdef ARPHRD_IEEE1394
156 || Run->CardType == ARPHRD_IEEE1394
157#endif
158 )
150 ) { 159 ) {
@@ -164,3 +173,20 @@ InterfaceInfo * LanCardRun::getInterface( void ) {
164bool LanCardRun::handlesInterface( const QString & S ) { 173bool LanCardRun::handlesInterface( const QString & S ) {
174 InterfaceInfo * II;
175 II = NSResources->system().interface( S );
176 if( ( II = NSResources->system().interface( S ) ) ) {
177 return handlesInterface( *II );
178 }
165 return Pat.match( S ) >= 0; 179 return Pat.match( S ) >= 0;
166} 180}
181
182bool LanCardRun::handlesInterface( const InterfaceInfo & II ) {
183 if( Pat.match( II.Name ) < 0 )
184 return 0;
185
186 if( Data->AnyLanCard ) {
187 return 1;
188 }
189
190 // must also match hardware address
191 return ( Data->HWAddresses.findIndex( II.MACAddress ) >= 0 );
192}