policy: update device's metered property when connection changes

If the metered property of a connection is changed, an activated
device associated to the connection must be updated immediately with
the new metered value.

https://bugzilla.gnome.org/show_bug.cgi?id=754409
This commit is contained in:
Beniamino Galvani 2015-09-07 12:06:27 +02:00
parent 94fea0b581
commit d910c94beb
3 changed files with 5 additions and 3 deletions

View file

@ -68,7 +68,6 @@ _LOG_DECLARE_SELF (NMDevice);
#include "nmdbus-device.h"
static void nm_device_update_metered (NMDevice *self);
static void ip_check_ping_watch_cb (GPid pid, gint status, gpointer user_data);
static gboolean ip_config_valid (NMDeviceState state);
static NMActStageReturn dhcp4_start (NMDevice *self, NMConnection *connection, NMDeviceStateReason *reason);
@ -7841,7 +7840,7 @@ nm_device_set_dhcp_anycast_address (NMDevice *self, const char *addr)
priv->dhcp_anycast_address = g_strdup (addr);
}
static void
void
nm_device_update_metered (NMDevice *self)
{
#define NM_METERED_INVALID ((NMMetered) -1)

View file

@ -498,6 +498,7 @@ const NMPlatformIP4Route *nm_device_get_ip4_default_route (NMDevice *self, gbool
const NMPlatformIP6Route *nm_device_get_ip6_default_route (NMDevice *self, gboolean *out_is_assumed);
void nm_device_spawn_iface_helper (NMDevice *self);
void nm_device_update_metered (NMDevice *self);
G_END_DECLS

View file

@ -1663,8 +1663,10 @@ connection_updated (NMSettings *settings,
}
}
if (device)
if (device) {
firewall_update_zone (policy, connection, device);
nm_device_update_metered (device);
}
schedule_activate_all (policy);
}