Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b4a488d1824a2cc3514f9ee1298d805bd5edc893
Commit:     b4a488d1824a2cc3514f9ee1298d805bd5edc893
Parent:     df1c0b8468b34628ed12b103804a4576cd9af8bb
Author:     Stephen Hemminger <[EMAIL PROTECTED]>
AuthorDate: Thu Aug 30 22:16:22 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Aug 30 22:16:22 2007 -0700

    [BRIDGE]: Fix OOPS when bridging device without ethtool.
    
    Bridge code calls ethtool to get speed. The conversion to using
    only ethtool_ops broke the case of devices without ethtool_ops.
    This is a new regression in 2.6.23.
    
    Rearranged the switch to a logical order, and use gcc initializer.
    
    Ps: speed should have been part of the network device structure from
        the start rather than burying it in ethtool.
    
    Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
    Acked-by: Matthew Wilcox <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/bridge/br_if.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 749f0e8..9272f12 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -33,17 +33,17 @@
  */
 static int port_cost(struct net_device *dev)
 {
-       if (dev->ethtool_ops->get_settings) {
-               struct ethtool_cmd ecmd = { ETHTOOL_GSET };
-               int err = dev->ethtool_ops->get_settings(dev, &ecmd);
-               if (!err) {
+       if (dev->ethtool_ops && dev->ethtool_ops->get_settings) {
+               struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET, };
+
+               if (!dev->ethtool_ops->get_settings(dev, &ecmd)) {
                        switch(ecmd.speed) {
-                       case SPEED_100:
-                               return 19;
-                       case SPEED_1000:
-                               return 4;
                        case SPEED_10000:
                                return 2;
+                       case SPEED_1000:
+                               return 4;
+                       case SPEED_100:
+                               return 19;
                        case SPEED_10:
                                return 100;
                        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to