device: also flush nexthops

This commit is contained in:
Beniamino Galvani 2025-12-10 14:19:45 +01:00
parent 0115ea401f
commit c63db13d97
2 changed files with 4 additions and 0 deletions

View file

@ -13260,6 +13260,9 @@ activate_stage3_ip_config_for_addr_family(NMDevice *self, int addr_family)
* addresses and routes on activation.
*/
if (ip_ifindex > 0) {
nm_platform_ip_nexthop_flush(nm_device_get_platform(self),
AF_INET6,
ip_ifindex);
nm_platform_ip_route_flush(nm_device_get_platform(self),
AF_INET6,
ip_ifindex);

View file

@ -1237,6 +1237,7 @@ deactivate_cleanup(NMModem *self, NMDevice *device, gboolean stop_ppp_manager)
if (ifindex > 0) {
NMPlatform *platform = nm_device_get_platform(device);
nm_platform_ip_nexthop_flush(platform, AF_UNSPEC, ifindex);
nm_platform_ip_route_flush(platform, AF_UNSPEC, ifindex);
nm_platform_ip_address_flush(platform, AF_UNSPEC, ifindex);
nm_platform_link_change_flags(platform, ifindex, IFF_UP, FALSE);