1. 16 Apr, 2019 3 commits
  2. 15 Apr, 2019 4 commits
    • Thomas Haller's avatar
      cli: tab complete only full D-Bus paths if there is no prefix · 43d93e7c
      Thomas Haller authored
      When tab completing connections by path name without any already
      typed parts, only suggest full D-Bus paths. The numbers are duplicate
      and not preferred.
          $ nmcli connection show path <TAB>
          Display all 118 possibilities? (y or n)
          1                                            46                                           /org/freedesktop/NetworkManager/Settings/29
          10                                           47                                           /org/freedesktop/NetworkManager/Settings/3
          11                                           48                                           /org/freedesktop/NetworkManager/Settings/30
          12                                           49                                           /org/freedesktop/NetworkManager/Settings/31
          13                                           5                                            /org/freedesktop/NetworkManager/Settings/32
          $ nmcli connection show path <TAB>
          /org/freedesktop/NetworkManager/Settings/1   /org/freedesktop/NetworkManager/Settings/28  /org/freedesktop/NetworkManager/Settings/46
          $ nmcli connection modify path 4<TAB>
          4   40  41  42  43  44  45  46  47  48  49
    • Thomas Haller's avatar
      cli: prefer matching connections by "uuid" instead of "id" · 68bd018a
      Thomas Haller authored
      Scripts should refer to connections by UUID. That means, whenever a
      UUID matches, that is really what the user wants. The specifier "uuid"
      must have precedence over "id" (and all others). That means, we must
      search all connections.
      For example:
          $ UUIDS=($(nmcli -g TYPE,UUID connection show | sed -n 's/802-11-wireless://p'))
          $ nmcli -f connection.id,connection.uuid connection show "${UUIDS[@]}"
      in this case we must preferrably match by UUID, regardless of whether
      a "connection.id" exists.
      Note that if you have:
          $ nmcli connection show | grep fdf7b2d2-2858-3938-9b14-7f1b514a9a00
          b                                     fdf7b2d2-2858-3938-9b14-7f1b514a9a00  ethernet   --
          fdf7b2d2-2858-3938-9b14-7f1b514a9a00  ab9f3891-3420-335e-89da-f14c1b94c540  ethernet   --
      then certain commands will still select all matching connections:
          $ nmcli -f connection.id,connection.uuid --mode multiline connection show fdf7b2d2-2858-3938-9b14-7f1b514a9a00
          connection.id:                          fdf7b2d2-2858-3938-9b14-7f1b514a9a00
          connection.uuid:                        ab9f3891-3420-335e-89da-f14c1b94c540
          connection.id:                          b
          connection.uuid:                        fdf7b2d2-2858-3938-9b14-7f1b514a9a00
      This only makes a difference for commands that must pick only one profile:
          $ nmcli connection modify fdf7b2d2-2858-3938-9b14-7f1b514a9a00 con-name new-name
    • Thomas Haller's avatar
      cli: drop unnecessary NULL sentinel from nmc_complete_strings() · 87d16e93
      Thomas Haller authored
      Since commit 62b939de ('cli: add nmc_complete_strv() which takes a
      string array for completion that may contain NULL'), the sentinel is
      no longer needed.
    • Piotr Drąg's avatar
      po: update Polish (pl) translation · f917fabd
      Piotr Drąg authored
  3. 14 Apr, 2019 12 commits
  4. 13 Apr, 2019 11 commits
    • Thomas Haller's avatar
      release: update NEWS · 606980c3
      Thomas Haller authored
    • Thomas Haller's avatar
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      release: update NEWS · a0a577e2
      Thomas Haller authored
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      platform: support weakly tracked routing rules in NMPRulesManager · f41b4cac
      Thomas Haller authored
      Policy routing rules are global, and unlike routes not tied to an interface by ifindex.
      That means, while we take full control over all routes of an interface during a sync,
      we need to consider that multiple parties can contribute to the global set of rules.
      That might be muliple connection profiles providing the same rule, or rules that are added
      externally by the user. NMPRulesManager mediates for that.
      This is done by NMPRulesManager "tracking" rules.
      Rules that are not tracked by NMPRulesManager are completely ignored (and
      considered externally added).
      When tracking a rule, the caller provides a track-priority. If multiple
      parties track a rule, then the highest (absolute value of the) priority
      If the highest track-priority is positive, NMPRulesManager will add the rule if
      it's not present.
      When the highest track-priority is negative, then NMPRulesManager will remove the
      rule if it's present (enforce its absence).
      The complicated part is, when a rule that was previously tracked becomes no
      longer tracked. In that case, we need to restore the previous state.
      If NetworkManager added the rule earlier, then untracking the rule
      NMPRulesManager will remove the rule again (restore its previous absent
      By default, if NetworkManager had a negative tracking-priority and removed the
      rule earlier (enforced it to be absent), then when the rule becomes no
      longer tracked, NetworkManager will not restore the rule.
      Consider: the user adds a rule externally, and then activates a profile that
      enforces the absence of the rule (causing NetworkManager to remove it).
      When deactivating the profile, by default NetworkManager will not
      restore such a rule! It's unclear whether that is a good idea, but it's
      also unclear why the rule is there and whether NetworkManager should
      really restore it.
      Add weakly tracked rules to account for that. A tracking-priority of
      zero indicates such weakly tracked rules. The only difference between an untracked
      rule and a weakly tracked rule is, that when NetworkManager earlier removed the
      rule (due to a negative tracking-priority), it *will* restore weakly
      tracked rules when the rules becomes no longer (negatively) tracked.
      And it attmpts to do that only once.
      Likewise, if the rule is weakly tracked and already exists when
      NMPRulesManager starts posively tracking the rule, then it would not
      remove again, when no longer positively tracking it.
    • Thomas Haller's avatar
      platform: add nmp_rules_manager_track_from_platform() · e18c92ee
      Thomas Haller authored
      Track all the rules that are currenlty in platform.
    • Thomas Haller's avatar
      platform: minor fixes in NMPRuleManager (assert and types) · dd9e6463
      Thomas Haller authored
      - fix the argument type to be "gint32" and not "int".
      - assert in nmp_rules_manager_track_default() for the input
      - use boolean bitfield in private data.
    • Thomas Haller's avatar
      platform/trivial: rename priority in NMPRuleManager to track_priority · 563894be
      Thomas Haller authored
      The name "priority" is overused. Also rules have a "priority", but that'
      something else.
      Rename the priority of how rules are tracked by NMPRuleManager to
    • Thomas Haller's avatar
      platform: drop track_default argument from nmp_rules_manager_new() · f281c62e
      Thomas Haller authored
      All that setting track-default does, is calling nmp_rules_manager_track_default()
      when the rules are first accessed.
      That is not right API. Since nmp_rules_manager_track_default() is already public
      API (good), every caller that wishes this behavior should track these routes explicitly.
    • Thomas Haller's avatar
  5. 12 Apr, 2019 10 commits
    • Lubomir Rintel's avatar
      core/qdisc: add support for attributes · 65831ee8
      Lubomir Rintel authored
    • Lubomir Rintel's avatar
      core/qdisc: drop useless code · f5f90a0d
      Lubomir Rintel authored
      The call to nm_utils_parse_variant_attributes() is useless. The following
      _tc_read_common_opts() call does the same thing. This was probably left
      in place by accident.
    • Lubomir Rintel's avatar
      nmcli: fix an error message when the tc qdisc kind is missing · 817b55cf
      Lubomir Rintel authored
        # nmcli c modify eth666 tc.qdiscs root
        Error: failed to modify tc.qdiscs: '(null)' is not a valid kind The valid syntax is: '[root | parent <handle>] [handle <handle>] <qdisc>'.
        # nmcli c modify eth666 tc.qdiscs root
        Error: failed to modify tc.qdiscs: kind is missing. The valid syntax is: '[root | parent <handle>] [handle <handle>] <kind>'.
    • Beniamino Galvani's avatar
      merge: branch 'bg/sanitizers' · 549112c1
      Beniamino Galvani authored
      Fix build with sanitizers, and other memory fixes
    • Beniamino Galvani's avatar
      device: fix memory leak · 82c74eb4
      Beniamino Galvani authored
    • Beniamino Galvani's avatar
      policy: fix memory leak · ade14408
      Beniamino Galvani authored
    • Beniamino Galvani's avatar
      libnm-core: fix wrong memory access in tests · 834dfd72
      Beniamino Galvani authored
      ==16725==ERROR: AddressSanitizer: global-buffer-overflow on address 0x0000005a159f at pc 0x00000046fc1b bp 0x7fff6038f900 sp 0x7fff6038f8f0
      READ of size 1 at 0x0000005a159f thread T0
          #0 0x46fc1a in _do_test_unescape_spaces libnm-core/tests/test-general.c:7791
          #1 0x46fe5b in test_nm_utils_unescape_spaces libnm-core/tests/test-general.c:7810
          #2 0x7f4ac5fe7fc9 in test_case_run gtestutils.c:2318
          #3 0x7f4ac5fe7fc9 in g_test_run_suite_internal gtestutils.c:2403
          #4 0x7f4ac5fe7e83 in g_test_run_suite_internal gtestutils.c:2415
          #5 0x7f4ac5fe7e83 in g_test_run_suite_internal gtestutils.c:2415
          #6 0x7f4ac5fe8281 in g_test_run_suite gtestutils.c:2490
          #7 0x7f4ac5fe82a4 in g_test_run (/lib64/libglib-2.0.so.0+0x772a4)
          #8 0x48240d in main libnm-core/tests/test-general.c:7994
          #9 0x7f4ac5dc9412 in __libc_start_main (/lib64/libc.so.6+0x24412)
          #10 0x423ffd in _start (/home/bgalvani/work/NetworkManager/libnm-core/tests/test-general+0x423ffd)
      0x0000005a159f is located 49 bytes to the right of global variable '*.LC370' defined in 'libnm-core/tests/test-general.c' (0x5a1560) of size 14
        '*.LC370' is ascii string 'nick-5, green'
      0x0000005a159f is located 1 bytes to the left of global variable '*.LC371' defined in 'libnm-core/tests/test-general.c' (0x5a15a0) of size 1
        '*.LC371' is ascii string ''
      SUMMARY: AddressSanitizer: global-buffer-overflow libnm-core/tests/test-general.c:7791 in _do_test_unescape_spaces
    • Beniamino Galvani's avatar
      clients: disable asan leak detection in client tests · 2fe91419
      Beniamino Galvani authored
      Leak detection adds unhelpful messages to the stderr of nmcli, making
      tests fail. For example:
       ==17156==ERROR: LeakSanitizer: detected memory leaks
       Direct leak of 256 byte(s) in 2 object(s) allocated from:
           #0 0x7f08c7e27c88 in realloc (/lib64/libasan.so.5+0xefc88)
           #1 0x7f08c7546e7d in g_realloc (/lib64/libglib-2.0.so.0+0x54e7d)
    • Beniamino Galvani's avatar
      build: fix build with sanitizers · 366f9867
      Beniamino Galvani authored
      Add missing linker flags.
    • Thomas Haller's avatar
      all: merge branch 'th/strsplit-pt2' · 8c3fc3c5
      Thomas Haller authored