diff --git a/ChangeLog b/ChangeLog index 2a056dfdd7..b52cb6665f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-10-08 Dan Williams + + * src/NetworkManagerSystem.c + - (find_route): ref the route so it doesn't get destroyed when the cache + is cleared + - (nm_system_device_set_priority): unref the route here after it's done + being used + 2008-10-08 Dan Williams * src/nm-serial-device.c diff --git a/src/NetworkManagerSystem.c b/src/NetworkManagerSystem.c index 2db294c66b..7f49e3abdc 100644 --- a/src/NetworkManagerSystem.c +++ b/src/NetworkManagerSystem.c @@ -796,6 +796,8 @@ find_route (struct nl_object *object, gpointer user_data) if (addr->prefix == nl_addr_get_prefixlen (dst) && (addr->address & nm_utils_ip4_prefix_to_netmask (addr->prefix)) == dst_addr->s_addr) { + /* Ref the route so it sticks around after the cache is cleared */ + rtnl_route_put (route); info->route = route; break; } @@ -823,5 +825,6 @@ nm_system_device_set_priority (const char *iface, rtnl_route_set_prio (info.route, priority); rtnl_route_add (nlh, info.route, 0); + rtnl_route_put (info.route); } }