[IPOIB] fixing bugs in previous commit. (mlnx 5205)
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 1 Dec 2009 16:35:45 +0000 (16:35 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 1 Dec 2009 16:35:45 +0000 (16:35 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2608 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/ipoib_adapter.c
ulp/ipoib/kernel/ipoib_driver.c

index 80cba64..90757e4 100644 (file)
@@ -207,7 +207,7 @@ ipoib_create_adapter(
 \r
        ETH_COPY_NETWORK_ADDRESS( p_adapter->params.conf_mac.addr, p_adapter->mac.addr );\r
        /* If there is a NetworkAddress override in registry, use it */\r
-       if( (status == NDIS_STATUS_SUCCESS) && (len == HW_ADDR_LEN) )\r
+       if( (len == HW_ADDR_LEN) && (mac != NULL) )\r
        {\r
                if( ETH_IS_MULTICAST(mac) || ETH_IS_BROADCAST(mac) ||\r
                        !ETH_IS_LOCALLY_ADMINISTERED(mac) )\r
index f8809bc..32cad65 100644 (file)
@@ -603,12 +603,16 @@ ipoib_get_adapter_params(
 \r
        p_adapter->params.xfer_block_size = (sizeof(eth_hdr_t) + p_adapter->params.payload_mtu);\r
        NdisReadNetworkAddress( &status, p_mac, p_len, h_config );\r
-\r
+       if (status != NDIS_STATUS_SUCCESS) {\r
+               // Don't rely on NDIS, zero the values\r
+               *p_mac = NULL;\r
+               *p_len = 0;\r
+       }\r
 \r
        NdisCloseConfiguration( h_config );\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
-       return status;\r
+       return NDIS_STATUS_SUCCESS;\r
 }\r
 \r
 \r