1. 14 Apr, 2017 8 commits
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      route-manager: normalize host part of tracked routes in _vx_route_sync() · 5c54b7a3
      Thomas Haller authored
      The input list of routes is allowed to contain non-normalized routes,
      that is, routes which host part is non-zero. Such routes are rejected
      by kernel, but NM should transparently allow them (by normalizing
      the host part).
      The ID comparison function route_id_cmp() already properly ignored
      the (possibly non-zero) host part. However, in the internal list we
      also should make sure not to track such routes. We achive that by
      normalizing the host part to zero.
      Note that below we check whether the tracked route is idential to
      the route configured at platform. If we don't normalize the host part,
      the comparison will always indicate that the route is not yet
      configured, and thus we will re-sync the route every time.
    • Thomas Haller's avatar
      src: only compare network parts of routes in nm_utils_match_connection() · 034b7fb5
      Thomas Haller authored
      Kernel requires that routes have a host part of zero. For NetworkManager
      configuration we allow non-zero host parts (but ignore them). Fix
      route_compare() to ignore the host part.
      This has only effect during assuming connections. That means, on
      restart NM would fail to match a connection with static routes
      if it has a non-zero host part. So, the impact is rather small.
    • Thomas Haller's avatar
      platform: only consider net part of routes for route cache's ID · 57b0dce0
      Thomas Haller authored
      Routes with a non-zero host part are not allowed by kernel and
      don't really exist. We didn't reject such routes in users configuration,
      so various part of NM allow such routes. NM should silently strip
      the host part.
      Extend the cache's route ID to clear the host part too.
      Note that NM's handling of routes is fundamentally flawed, as
      for kernels routes don't have an "id" (or rather: all properties
      of a route are part of it's ID, not only the family,ifindex,
      network/plen and metric tuple (see related bug rh#1337855).
    • Thomas Haller's avatar
      platform: cleanup possibly non-zero host part for route operations · 11d8c418
      Thomas Haller authored
      Platform's add/remove operations accept a "network" argument.
      Kernel requires that the host part (based on plen) is all zero.
      For NetworkManager we are more resilient to user configuration.
      Cleanup the input argument already before calling _nl_msg_new_route().
      Note that we use the same "network" argument to construct a obj_id
      instance and to find the route in the cache (do_add_addrroute()).
      Without cleaning the host part, the added object cannot be found
      and the add-route command seemingly fails.
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      vpn: inline call_plugin_disconnect() · b23484be
      Thomas Haller authored
      There is only one caller. Don't bother moving the logic to a separate
    • Thomas Haller's avatar
      vpn: avoid calling call_plugin_disconnect() without proxy · bc1d1c9d
      Thomas Haller authored
      Got an assertion due to priv-proxy unset.
          - _platform_link_cb_idle()
           - nm_device_unrealize() [NMDeviceTun]
            - nm_device_state_changed()
             - _set_state_full()
                 - _set_vpn_state()
                  - call_plugin_disconnect()
      It seam to me, that can only happen if the NMVpnConnection never
      completed on_proxy_acquired() and is still in preparing state when
      being disconnected.
      Avoid that be checking whether we have a proxy.
  2. 13 Apr, 2017 9 commits
  3. 12 Apr, 2017 23 commits