diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2017-03-16 14:01:42 +0000 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2017-03-16 15:14:54 +0000 |
commit | dd57fa9a05a807f40ab66d158e1316fab710c351 (patch) | |
tree | 6ed24e0160b99f0383986ed4d1c9e7c7cc9b00a9 | |
parent | 2da0e7eae1c02d0c6bd49de50ab52e9dc47c8937 (diff) |
route-manager: emit a signal when IPv4 routes change
The devices will use this to reconsider their RP filtering decisions.
-rw-r--r-- | src/nm-route-manager.c | 16 | ||||
-rw-r--r-- | src/nm-route-manager.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/nm-route-manager.c b/src/nm-route-manager.c index 17bef1fc1..3b6a5d470 100644 --- a/src/nm-route-manager.c +++ b/src/nm-route-manager.c @@ -63,6 +63,12 @@ typedef struct { /*****************************************************************************/ +enum { + IP4_ROUTES_CHANGED, + LAST_SIGNAL, +}; +static guint signals[LAST_SIGNAL] = { 0 }; + NM_GOBJECT_PROPERTIES_DEFINE_BASE ( PROP_PLATFORM, ); @@ -904,6 +910,9 @@ next: } } + if (vtable->vt->is_ip4 && ipx_routes_changed) + g_signal_emit (self, signals[IP4_ROUTES_CHANGED], 0); + g_free (known_routes_idx); g_free (plat_routes_idx); g_array_unref (plat_routes); @@ -1285,4 +1294,11 @@ nm_route_manager_class_init (NMRouteManagerClass *klass) G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties); + + signals[IP4_ROUTES_CHANGED] = + g_signal_new (NM_ROUTE_MANAGER_IP4_ROUTES_CHANGED, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 0); } diff --git a/src/nm-route-manager.h b/src/nm-route-manager.h index 181d794ee..328fa8cba 100644 --- a/src/nm-route-manager.h +++ b/src/nm-route-manager.h @@ -30,6 +30,8 @@ #define NM_ROUTE_MANAGER_PLATFORM "platform" +#define NM_ROUTE_MANAGER_IP4_ROUTES_CHANGED "ip4-routes-changed" + typedef struct _NMRouteManagerClass NMRouteManagerClass; GType nm_route_manager_get_type (void); |