Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: New "networkmanager.passthrough" structure (LP: #2080301) #522

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Commits on Nov 8, 2024

  1. parse: new structure for "passthrough"

    The networkmanager.passthrough section stores raw keyfile information
    using a format that can be tricky to interpret. It will concatenate the
    group and key names separated by dots. Unfortunately, Network Manager
    accepts multiple dots in the middle of both the group and key names.
    Because of that it's hard, if even possible, to determine where the
    strings must be split.
    
    Ex:
    networkmanager:
      passthrough:
        group_name.key_name: value1
        group_name.key_name1: value2
    
    The new format stores the same information in YAML mappings. By using
    this format, parsing the group and key names is not needed anymore.
    
    Ex:
    networkmanager:
      passthrough:
        group_name:
          key_name1: value1
          key_name2: value2
    
    The datalist data structure was replaced by hash tables. The entire
    passthrough section is represented by a hash table indexed by the group
    name. Each entry is also a hash table representing all the key/value
    entries and it's indexed by the key name.
    daniloegea committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    a67463a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a2d5e8c View commit details
    Browse the repository at this point in the history
  3. config_fuzzer: run generate -i against the entire dataset

    Now that the datalist was replaced with hash tables, run the generator
    with --ignore-errors against the entire dataset. The datalist was
    leaking memory and causing ASAN to crash the test.
    
    Also limit the value of path-cost to avoid triggering a g_assert(v <
    G_MACUINT).
    daniloegea committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    23cd665 View commit details
    Browse the repository at this point in the history
  4. tests: update config_fuzzer with new passthrough format

    Now it will generate a mix of old and new formats in the passthrough
    section.
    daniloegea committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    f3762c9 View commit details
    Browse the repository at this point in the history
  5. nm: fix crashes when errors are ignored

    When --ignore-errors is used, some netdefs might arrive at the NM config
    writers in a bad state. In such cases we just skip them.
    
    Found with config_fuzzer.
    daniloegea committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    f94a59f View commit details
    Browse the repository at this point in the history
  6. parse: fix uninitialized variable

    Fixes the build on Fedora 41:
    
    In file included from /usr/include/glib-2.0/glib.h:117,
                     from ../src/parse.c:25:
    In function ‘g_autoptr_cleanup_generic_gfree’,
        inlined from ‘get_ip_family’ at ../src/parse.c:1918:22:
    /usr/include/glib-2.0/glib/glib-autocleanups.h:32:3: error: ‘ip_str’ may be used uninitialized [-Werror=maybe-uninitialized]
       32 |   g_free (*pp);
          |   ^~~~~~~~~~~~
    ../src/parse.c: In function ‘get_ip_family’:
    ../src/parse.c:1918:22: note: ‘ip_str’ was declared here
     1918 |     g_autofree char *ip_str;
          |                      ^~~~~~
    cc1: all warnings being treated as errors
    daniloegea committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    b954585 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8addc9a View commit details
    Browse the repository at this point in the history
  8. ci/rpmbuild: install gdb

    The RPM build started to fail on Fedora 41:
    
    find-debuginfo: starting
    Extracting debug info from 4 files
    gdb-add-index: Failed to find a useable GDB binary
    daniloegea committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    a381373 View commit details
    Browse the repository at this point in the history