summaryrefslogtreecommitdiff
path: root/src/systemd
diff options
context:
space:
mode:
authorUmut Tezduyar Lindskog <umut.tezduyar@axis.com>2014-03-21 19:23:35 +0100
committerTom Gundersen <teg@jklm.no>2014-03-21 20:24:10 +0100
commitb5db00e52ee2e20578839e4e4488f7b9af9abc38 (patch)
treeb17e48e7d09372e8d7e9b4e86356711d169a16cf /src/systemd
parent18bb8adb06002a5963a3373fa30c12cfa89b9724 (diff)
sd-ipv4ll/networkd: generate predictable addresses
Increase the chance of using the same link local address between reboots. The pseudo random sequence of addresses we attempt is now seeded with data that is very likely to stay the same between reboots, but at the same time be unique to the specific machine/nic. First we try to use the ID_NET_NAME_* data from the udev db combined with the machin-id, which is guaranteed to be unique and persistent, if available. If that is not possible (e.g., in containers where we don't have access to the udev db) we fallback to using the MAC address of the interface, which is guaranteed to be unique, and likely to be persistent. [tomegun: three minor changes: - don't expose HASH_KEY in the siphash24 header - get rid of some compile-warnings (and some casts at the same time), by using uint8_t[8] rather than uint64_t in the api - added commit message]
Diffstat (limited to 'src/systemd')
-rw-r--r--src/systemd/sd-ipv4ll.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/systemd/sd-ipv4ll.h b/src/systemd/sd-ipv4ll.h
index 0207006ff..6273c8917 100644
--- a/src/systemd/sd-ipv4ll.h
+++ b/src/systemd/sd-ipv4ll.h
@@ -42,6 +42,7 @@ int sd_ipv4ll_get_address(sd_ipv4ll *ll, struct in_addr *address);
int sd_ipv4ll_set_callback(sd_ipv4ll *ll, sd_ipv4ll_cb_t cb, void *userdata);
int sd_ipv4ll_set_mac(sd_ipv4ll *ll, const struct ether_addr *addr);
int sd_ipv4ll_set_index(sd_ipv4ll *ll, int interface_index);
+int sd_ipv4ll_set_address_seed (sd_ipv4ll *ll, uint8_t seed[8]);
int sd_ipv4ll_start (sd_ipv4ll *ll);
int sd_ipv4ll_stop (sd_ipv4ll *ll);
void sd_ipv4ll_free (sd_ipv4ll *ll);