rpmbuild buils NM with -fexceptions, which causes -Wmaybe-uninitialized
warnings for auto variables that have a cleanup function.
Maybe we should not build RPM packages with -fexceptions,
but anyway, for now just fix the build.
This reverts partly commit 4a58425dbf
and adds more fixes of uninitialized variables.
Update internal dhcp library with new code from upstream systemd.
HEAD=117cb022b13cedf4035e2a778b8d61528075a8b4
MERGE=$(git rev-list --merges -n1 $HEAD)
# how did we modify the systemd code?
git diffs $MERGE^1 $HEAD -- :/src/dhcp-manager/systemd-dhcp/
# what changed in systemd since last merge:
git diffs $MERGE^2 $HEAD -- :/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/
https://bugzilla.gnome.org/show_bug.cgi?id=742719
systemd compiles with -std=gnu99, while we compile our sources with
-std=gnu89. Hence __STDC_VERSION__ is not defined.
As we define -std=gnu98 as CFLAGS with --enable-more-warnings, we cannot
overwrite it via libsystemd_dhcp_la_CFLAGS because the (user provided)
CFLAGS takes precedence.
sd-dhcp6-client.c uses ARPHRD_ETHER and more from net/if_arp.h.
In upstream systemd code, that header is included indirectly via
udev.h. As we don't include udev.h, include net/if_arp.h
directly in the adapter.
This function was added to inject the ifname to the dhcp6 client.
As dhcp_identifier_set_iaid() now looks up the name itself by calling
if_indextoname(), this is no longer needed.
Also patch dhcp_identifier_set_iaid() to get the ifname via
if_indextoname(), instead of udev.
This also makes our local modification sd_dhcp6_client_set_ifname()
obsolete, which will be removed next.
The 'log.h' header from systemd implements most logging commands based on a
few fundamental logging commands. Reuse 'log.h' for most parts and let the
adapter only redefine the necessary commands.
I cannot reproduce any compiler warnings with these changes.
I think it is desirable, that our version of the code is
as similar as possible to the upstream systemd code.
Undo these local modifications.
Make our copy more similar to what systemd has by removing
local changes that are unnecessary.
These changes don't affect the build, because the code is excluded
with #if 0.
dcbw added a comment line and submitted the patch to systemd.
The patch was merged without the comment. Remove it also from our
version, to make the file more similar to what systemd has.
Only basic merging. The result does not yet compile.
https://bugzilla.gnome.org/show_bug.cgi?id=742719
Conflicts:
src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-packet.c
src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.c
src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.h
src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-lease.c
src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c
src/dhcp-manager/systemd-dhcp/src/shared/macro.h
src/dhcp-manager/systemd-dhcp/src/shared/strv.c
src/dhcp-manager/systemd-dhcp/src/shared/util.c
src/dhcp-manager/systemd-dhcp/src/shared/util.h
src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-client.h
The statement
g_return_val_if_reached (NM_MODEM_IP_TYPE_UNKNOWN);
was wrong, because the return type is 'const char *'.
But just refactor nm_modem_ip_type_to_string() to get rid of
the static table and make it a switch statement.
Fixes: 85d9132464
A gnu extension to printf adds the format specifier "%m"
to print @errno. To preserve the error number until the
point where the logging statement is constructed, pass
it as an additional argument to _nm_log().
This is not (yet) used from NM internal code. But systemd is adding
similar functionality to its logging functions. Add the same also to
nm-logging, to support systemd's usage of "%m".
This does not yet work, because the --order option
contains colons which bash completion considers as
separaters.
For now, implement it and ignore that problem. It
works correctly until you specify more then one
order-columns separated by colon.
https://bugzilla.gnome.org/show_bug.cgi?id=738613
Fixes: 40e98f5d68
dhclient only supports fqdn.fqdn for server DDNS updates with
DHCPv6. And even though the underlying DHCP options that fqdn.fqdn
controls allow non-qualified hostnames on the wire, dhclient does
not. So we must require a fully-qualified name for DHCPv6.
Second, while no-client-updates seems like it should be "off", doing
that apparently makes dhclient set the "O" flag to 1 which appears to
be a bug, and results in the server not doing the DDNS update. So
we must stop setting that option too.
Found by: Alexander Groß