This patch implements the stable privacy address generation for link-local and autoconf addresses as specified in RFC7217. RID = F(Prefix, Net_Iface, Network_ID, DAD_Counter, secret_key) is the RID (random identifier). As the hash function F we chose one round of sha1. Prefix will be either the link-local prefix or the router advertised one. As Net_Iface we use the MAC address of the device. DAD_Counter and secret_key are implemented as specified. We don't use Network_ID, as it couples the code too closely to other subsystems. It is specified as optional in the RFC. As Net_Iface we only use the MAC address: we simply have no stable identifier in the kernel we could possibly use: because this code might run very early, we cannot depend on names, as they might be changed by user space early on during the boot process. A new address generation mode is introduced, IN6_ADDR_GEN_MODE_STABLE_PRIVACY. With iproute2 one can switch back to none or eui64 address configuration mode although the stable_secret is already set. We refuse writes to ipv6/conf/all/stable_secret but only allow ipv6/conf/default/stable_secret and the interface specific file to be written to. The default stable_secret is used as the parameter for the namespace, the interface specific can overwrite the secret, e.g. when switching a network configuration from one system to another while inheriting the secret.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -216,6 +216,7 @@ enum { · 215 unmodified lines | ||
| 216 | 216 | enum in6_addr_gen_mode { |
| 217 | 217 | IN6_ADDR_GEN_MODE_EUI64, |
| 218 | 218 | IN6_ADDR_GEN_MODE_NONE, |
| 219 | + IN6_ADDR_GEN_MODE_STABLE_PRIVACY, | |
| 219 | 220 | }; |
| 220 | 221 | |
| 221 | 222 | /* Bridge section */ |