Commit graph

2 commits

Author SHA1 Message Date
Thomas Haller
3be4f38a15
keyfile: cleanup uses of GString in keyfile code
- in _keyfile_key_decode(), don't use GString. We know the maximum
  string length before, so we can just allocated one buffer.

- in qdisc and tfilter writers, reuse the same GString instance.
  No need to allocate a new temporary string buffer for each iteration.

- at other places, replace GString by NMStrBuf. This avoids the heap
  allocated GString instance. Also, most operations can be inlined.
  This results in larger code side, but avoids function calls to glib.
2020-06-26 09:29:54 +02:00
Thomas Haller
b760dee8c8
all: move "shared/nm-keyfile" to "libnm-core/nm-keyfile"
Originally, these files were part of libnm-core and linked together.
However, that is a licensing violation, because the code is GPL-2.0+
licensed, while libnm-core also gets linked with libnm (it must thus
be LGPL-2.1+). The original intent behind moving the code to "shared/"
was to avoid the licensing issue, but also to prepare when we would add
a separate, GPL licensed libnm-keyfile. However, currently we hope to
be able to relicense the code, so that it actually could be exposed as
part of libnm. This is work in progress at ([1]).

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/ ## 517

Anyway, the current directory layout is problematic. libnm-keyfile
depends on libnm-core, while libnm-core depends on code under shared.
That means, there is a circular dependency and meson's subdir() does
not work well.

Move the code.
2020-06-11 10:53:50 +02:00
Renamed from shared/nm-keyfile/nm-keyfile.c (Browse further)