After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 699391 - move hw-address properties into NMDevice
move hw-address properties into NMDevice
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-05-01 14:22 UTC by Dan Winship
Modified: 2013-05-03 17:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core: reorganize hw-address properties (67.35 KB, patch)
2013-05-01 14:22 UTC, Dan Winship
committed Details | Review

Description Dan Winship 2013-05-01 14:22:34 UTC
I really didn't want to copy+paste the hw-address property code 6 or 7 more times for the new virtual device types...

The basics definitely work, but it will need a little more testing. Notes:

  - As mentioned in the commit message, this doesn't affect the D-Bus API

  - This does cause the daemon-side NMDeviceModem to have a :hw-address
    property now, but it should always be NULL.

  - It is supposed to preserve the behavior that nm_device_get_hw_address()
    returns NULL for NMDeviceADSL except when the device is connected

  - The NMDeviceBond code attempts to correctly deal with the bond device
    having either an ETH_ALEN or an INFINIBAND_ALEN address
Comment 1 Dan Winship 2013-05-01 14:22:44 UTC
Created attachment 242997 [details] [review]
core: reorganize hw-address properties

Now that NMDevice reads the hwaddr directly from netlink, it's silly
to have every device subtype maintain its own hw-address property
(using data that it gets from the NMDevice base class).

Remove all the device-specific hw-address properties, and add one to
NMDevice instead. (Because of the way nm-properties-changed-signal
works, this has no effect on the D-Bus API.) Subclasses now call
nm_device_get_hw_address() in places where they used to just refer to
priv->hw_addr (and to simplify this, we now allow passing NULL for the
out length parameter, since the subclasses almost always know what the
length will be already).

Also reorganize/simplify a few other methods to take advantage of the
fact that NMDevice is now keeping track of the hw-address directly.
Comment 2 Dan Winship 2013-05-01 19:19:59 UTC
oh, also danw/hwaddr branch
Comment 3 Dan Williams 2013-05-03 17:18:37 UTC
Looks good.
Comment 4 Dan Winship 2013-05-03 17:20:38 UTC
Attachment 242997 [details] pushed as 9ce4582 - core: reorganize hw-address properties