diff options
| author | Dan Williams <dcbw@redhat.com> | 2013-04-10 13:34:32 -0500 |
|---|---|---|
| committer | Dan Williams <dcbw@redhat.com> | 2013-04-10 13:37:22 -0500 |
| commit | 6701181c358db34d77ec553fb01ea51705862485 (patch) | |
| tree | 32cfe0c530d8ad7ada2351581141f9db5c239938 | |
| parent | ac697a912e07e9ad3d1c815591f2aaad07e17093 (diff) | |
| download | NetworkManager-6701181c358db34d77ec553fb01ea51705862485.tar.gz | |
ethernet: don't crash for PPPoE connections with no wired setting
PPPoE connections don't necessarily have a wired setting, so don't
require one here.
| -rw-r--r-- | src/nm-device-ethernet.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c index 6b4ca7b09e..5aa7a6c929 100644 --- a/src/nm-device-ethernet.c +++ b/src/nm-device-ethernet.c @@ -1036,13 +1036,13 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) req = nm_device_get_act_request (NM_DEVICE (self)); g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE); - s_wired = NM_SETTING_WIRED (device_get_setting (dev, NM_TYPE_SETTING_WIRED)); - g_assert (s_wired); - - /* Set device MAC address if the connection wants to change it */ - cloned_mac = nm_setting_wired_get_cloned_mac_address (s_wired); - if (cloned_mac && (cloned_mac->len == ETH_ALEN)) - _set_hw_addr (self, (const guint8 *) cloned_mac->data, "set"); + s_wired = (NMSettingWired *) device_get_setting (dev, NM_TYPE_SETTING_WIRED); + if (s_wired) { + /* Set device MAC address if the connection wants to change it */ + cloned_mac = nm_setting_wired_get_cloned_mac_address (s_wired); + if (cloned_mac && (cloned_mac->len == ETH_ALEN)) + _set_hw_addr (self, (const guint8 *) cloned_mac->data, "set"); + } } return ret; |
