diff options
author | Thomas Haller <thaller@redhat.com> | 2018-11-23 12:11:38 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-11-29 07:48:20 +0100 |
commit | 80ac8e40a258ba85fb9a2f079ecf5bdf5dcde0da (patch) | |
tree | 3fcf536165d01b14c5517189da28deba434aa8c1 /src/systemd | |
parent | f2f44a7acaeec4681d37c3cffffb5601c2e421f2 (diff) | |
download | NetworkManager-80ac8e40a258ba85fb9a2f079ecf5bdf5dcde0da.tar.gz |
dhcp: disable systemd's dhcp_identifier_set_iaid()
dhcp_identifier_set_iaid() is no longer called. Replace
the code with an assertion and always fail.
The function was already annoying previously, because it would
require udev API to generate the IAID. So, we were already required
to patch this function.
Diffstat (limited to 'src/systemd')
-rw-r--r-- | src/systemd/src/libsystemd-network/dhcp-identifier.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/systemd/src/libsystemd-network/dhcp-identifier.c b/src/systemd/src/libsystemd-network/dhcp-identifier.c index 9cb64344ec..a9fc8de164 100644 --- a/src/systemd/src/libsystemd-network/dhcp-identifier.c +++ b/src/systemd/src/libsystemd-network/dhcp-identifier.c @@ -15,11 +15,6 @@ #include "sparse-endian.h" #include "virt.h" -#if 0 /* NM_IGNORED */ -#else /* NM_IGNORED */ -#include <net/if.h> -#endif /* NM_IGNORED */ - #define SYSTEMD_PEN 43793 #define HASH_KEY SD_ID128_MAKE(80,11,8c,c2,fe,4a,03,ee,3e,d6,0c,6f,36,39,14,09) #define APPLICATION_ID SD_ID128_MAKE(a5,0a,d1,12,bf,60,45,77,a2,fb,74,1a,b1,95,5b,03) @@ -169,14 +164,10 @@ int dhcp_identifier_set_iaid( /* name is a pointer to memory in the sd_device struct, so must * have the same scope */ _cleanup_(sd_device_unrefp) sd_device *device = NULL; -#else /* NM_IGNORED */ - char name_buf[IF_NAMESIZE]; -#endif /* NM_IGNORED */ const char *name = NULL; uint64_t id; uint32_t id32; -#if 0 /* NM_IGNORED */ if (detect_container() <= 0) { /* not in a container, udev will be around */ char ifindex_str[2 + DECIMAL_STR_MAX(int)]; @@ -194,9 +185,6 @@ int dhcp_identifier_set_iaid( name = net_get_name(device); } } -#else /* NM_IGNORED */ - name = if_indextoname(ifindex, name_buf); -#endif /* NM_IGNORED */ if (name) id = siphash24(name, strlen(name), HASH_KEY.bytes); @@ -218,4 +206,9 @@ int dhcp_identifier_set_iaid( unaligned_write_ne32(_id, id32); return 0; +#else /* NM_IGNORED */ + /* for NetworkManager, we don't use this function and we should never call here. + * This got replaced by nm_utils_create_dhcp_iaid(). */ + g_return_val_if_reached (-EINVAL); +#endif /* NM_IGNORED */ } |