Bug 1008566 - InfiniBand device matching
InfiniBand device matching
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Dan Winship
Desktop QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-16 11:37 EDT by Dan Winship
Modified: 2014-06-17 22:49 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 07:17:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Add additional checks to spec_match_list (1.45 KB, patch)
2013-09-17 09:01 EDT, Thomas Haller
no flags Details | Diff

  None (edit)
Description Dan Winship 2013-09-16 11:37:51 EDT
Doug Ledford says:

> You can't match on the whole HWADDR in the ifcfg-*_ib? files.  Only
> the last 8 bytes are tied to the hardware like a MAC address, the
> remainder of the bytes are all things that can change due to external
> factors and should not be considered when matching interfaces on the
> system against interface definition files.  Currently, multiple of the
> rdma-dev-0? machines exhibit this behavior because I changed the subnet
> prefix, which changes byte 9 of the HWADDR.

This affects (at least) libnm-glib's nm_device_connection_compatible(), and the daemon's nm_device_check_connection_compatible() and nm_match_spec_hwaddr().
Comment 1 Dan Winship 2013-09-16 18:22:01 EDT
patches in danw/ib branch in git
Comment 2 Thomas Haller 2013-09-17 09:01:32 EDT
Created attachment 798804 [details]
Add additional checks to spec_match_list

nm_device_get_hw_address "can" return NULL, so check for it.

Apart from the attached patch, it looks good to me.
Comment 3 Jirka Klimes 2013-09-17 12:39:48 EDT
> infiniband: only check the last 8 bytes when doing hwaddr matches

Don't be want to compare case insensitively (I guess specs comes from the user)?
-strcmp (spec_str + 40, hwaddr_str + 36)
+strcasecmp (spec_str + 40, hwaddr_str + 36)

if (   g_str_has_prefix (iter->data, "mac:")
should be
if (   g_str_has_prefix (spec_str, "mac:")
to be consistent.

(In reply to Thomas Haller from comment #2)
> nm_device_get_hw_address "can" return NULL, so check for it.
> 
nm_device_get_hw_address () is also used in nm-device-infiniband.c, so the check for NULL should be done there too.
Comment 4 Dan Winship 2013-09-23 09:48:59 EDT
(In reply to Thomas Haller from comment #2)
> nm_device_get_hw_address "can" return NULL, so check for it.

Only for devices that sometimes don't have a hardware address (like bluetooth). It can't return NULL for InifiniBand.

However, the suggestion to short-circuit the check if specs is NULL makes sense, and I added that in another patch.

(In reply to Jirka Klimes from comment #3)
> Don't be want to compare case insensitively

oh, yes. Fixed and re-pushed.

(I assume that even though both of you only commented on this bug, that you reviewed the whole branch, including the part that applies to bug 1008568?)
Comment 5 Dan Winship 2013-09-24 11:56:51 EDT
fixed in git
Comment 7 Vladimir Benes 2014-04-03 07:14:06 EDT
ifcfg file with infiniband mac address seems to be working correctly
Comment 8 Ludek Smid 2014-06-13 07:17:37 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Note You need to log in before you can comment on or make changes to this bug.