From aa9b5e28eb6d85262c785b0ccd9c1d98c222089c Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 15 Mar 2022 17:44:49 +0100 Subject: [PATCH] ethernet: fix setting ip-ifindex for PPPoE connections When a NMDevice is involved in a PPPoE activation, it means that the connection has connection.interface-name=. In such case, the ppp ifindex should be set as ip-ifindex of the ethernet device. Fixes: 58287cbcc0c8 ('core: rework IP configuration in NetworkManager using layer 3 configuration') --- src/core/devices/nm-device-ethernet.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/devices/nm-device-ethernet.c b/src/core/devices/nm-device-ethernet.c index 7cddf9d838..4b6adfc13d 100644 --- a/src/core/devices/nm-device-ethernet.c +++ b/src/core/devices/nm-device-ethernet.c @@ -1163,11 +1163,10 @@ _ppp_mgr_callback(NMPppMgr *ppp_mgr, const NMPppMgrCallbackData *callback_data, gs_free char *old_name = NULL; gs_free_error GError *error = NULL; - if (!nm_device_take_over_link(device, callback_data->data.ifindex, &old_name, &error)) { + if (!nm_device_set_ip_ifindex(device, callback_data->data.ifindex)) { _LOGW(LOGD_DEVICE | LOGD_PPP, - "could not take control of link %d: %s", - callback_data->data.ifindex, - error->message); + "could not set ip-ifindex %d", + callback_data->data.ifindex); _ppp_mgr_cleanup(self); nm_device_state_changed(device, NM_DEVICE_STATE_FAILED,