diff --git a/src/Makefile.am b/src/Makefile.am index 2120fc2188..ead105de4a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -66,6 +66,8 @@ SYSTEMD_DHCP_CFLAGS = \ libsystemd_dhcp_la_SOURCES = \ dhcp-manager/systemd-dhcp/src/libsystemd/sd-id128/sd-id128.c \ + dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.c \ + dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.h \ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-network.c \ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-packet.c \ dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-internal.h \ diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.c index f7a1492363..c33761bc13 100644 --- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.c +++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.c @@ -19,13 +19,18 @@ along with systemd; If not, see . ***/ +#include "nm-sd-adapt.h" #include "sd-id128.h" +#if 0 /* NM_IGNORED a*/ #include "libudev.h" #include "udev-util.h" #include "virt.h" #include "sparse-endian.h" +#else /* NM_IGNORED */ +#include +#endif /* NM_IGNORED */ #include "siphash24.h" #include "dhcp6-protocol.h" @@ -59,12 +64,17 @@ int dhcp_identifier_set_duid_en(struct duid *duid, size_t *len) { int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, uint32_t *_id) { +#if 0 /* NM_IGNORED */ /* name is a pointer to memory in the udev_device struct, so must have the same scope */ _cleanup_udev_device_unref_ struct udev_device *device = NULL; +#else /* NM_IGNORED */ + char name_buf[IF_NAMESIZE]; +#endif /* NM_IGNORED */ const char *name = NULL; uint64_t id; +#if 0 /* NM_IGNORED */ if (detect_container(NULL) <= 0) { /* not in a container, udev will be around */ _cleanup_udev_unref_ struct udev *udev; @@ -84,6 +94,9 @@ int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, uint32_t name = net_get_name(device); } } +#else /* NM_IGNORED */ + name = if_indextoname(ifindex, name_buf); +#endif /* NM_IGNORED */ if (name) siphash24((uint8_t*)&id, name, strlen(name), HASH_KEY.bytes); diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.h b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.h index 643d4970d5..5d4da21cb0 100644 --- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.h +++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-identifier.h @@ -21,6 +21,7 @@ along with systemd; If not, see . ***/ +#include "nm-sd-adapt.h" #include "macro.h" #include "sparse-endian.h"