[rdma: 9/9] Don't use ifconfig on ipoib interfaces

Doug Ledford dledford at fedoraproject.org
Tue Aug 3 06:53:43 UTC 2010


commit b53a362dbbf5671c9691950eb4a7442acdb2f099
Author: Doug Ledford <dledford at redhat.com>
Date:   Tue Aug 3 01:45:48 2010 -0400

    Don't use ifconfig on ipoib interfaces
    
    Signed-off-by: Doug Ledford <dledford at redhat.com>

 rdma.init |    4 ++--
 rdma.spec |    5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/rdma.init b/rdma.init
index 6b11199..66fe9e7 100644
--- a/rdma.init
+++ b/rdma.init
@@ -55,7 +55,7 @@ UNLOAD_CORE_USER_MODULES="rdma_ucm ib_ucm ib_uverbs ib_umad"
 UNLOAD_CORE_CM_MODULES="rdma_cm ib_cm iw_cm"
 UNLOAD_CORE_MODULES="ib_addr ib_sa ib_mad ib_core"
 
-interfaces=`/sbin/ifconfig | grep "^ib[0-9]*" | cut -f 1 -d ' ' | sed -e 'y/\r/ /'`
+interfaces=`ip link show | grep ": ib[0-9]*" | cut -f 2 -d ' ' | sed -e 'y/\r/ /;s/://'`
 
 # If module $1 is loaded return - 0 else - 1
 is_module()
@@ -416,7 +416,7 @@ status()
 	cnt=0
 	for i in $interfaces
 	do
-	    ifconfig $i | grep UP > /dev/null 2>&1
+	    ip link show $i | grep -w UP > /dev/null 2>&1
 	    [ $? -eq 0 ] && echo -n "$i " && let cnt++
 	done
 	[ $cnt -eq 0 ] && echo -n "none"
diff --git a/rdma.spec b/rdma.spec
index 8ceccd6..18572f3 100644
--- a/rdma.spec
+++ b/rdma.spec
@@ -76,7 +76,10 @@ fi
   that don't need quoting in the second test due to the fact that the
   first test guarantees they exist.  Or that's how things should be, but
   they aren't, so rewrite tests to accommodate this fact. (bz612284)
-
+- Use ip instead of ifconfig as ifconfig knows it doesn't handle infinband
+  hardware addresses properly (even though we don't care, we aren't using
+  it for that) and prints out copious warning messages (bz613086)
+  
 * Thu Feb 25 2010 Doug Ledford <dledford at redhat.com> - 1.0-7
 - Minor tweak to rdma.init to silence udev warnings (bz567981)
 


More information about the scm-commits mailing list