Commit graph

14 commits

Author SHA1 Message Date
Thomas Haller
f0d40525df device: support dynamic "connection.stable-id" in form of text-substitution
Usecase: when connecting to a public Wi-Fi with MAC address randomization
("wifi.cloned-mac-address=random") you get on every re-connect a new
IP address due to the changing MAC address.
"wifi.cloned-mac-address=stable" is the solution for that. But that
means, every time when reconnecting to this network, the same ID will
be reused. We want an ID that is stable for a while, but at a later
point a new ID should e generated when revisiting the Wi-Fi network.

Extend the stable-id to become dynamic and support templates/substitutions.
Currently supported is "${CONNECTION}", "${BOOT}" and "${RANDOM}".
Any unrecognized pattern is treated verbaim/untranslated.

"$$" is treated special to allow escaping the '$' character. This allows
the user to still embed verbatim '$' characters with the guarantee that
future versions of NetworkManager will still generate the same ID.
Of course, a user could just avoid '$' in the stable-id unless using
it for dynamic substitutions.

Later we might want to add more recognized substitutions. For example, it
could be useful to generate new IDs based on the current time. The ${} syntax
is extendable to support arguments like "${PERIODIC:weekly}".

Also allow "connection.stable-id" to be set as global default value.
Previously that made no sense because the stable-id was static
and is anyway strongly tied to the identity of the connection profile.
Now, with dynamic stable-ids it gets much more useful to specify
a global default.

Note that pre-existing stable-ids don't change and still generate
the same addresses -- unless they contain one of the new ${} patterns.
2017-01-09 14:50:33 +01:00
Thomas Haller
21ae09c1cc core: add assertions for network_id/stable_type
We require a network-id. Assert that it is set.

Also, we encode the stable-id as uint8. Thus, add
an assertion that we don't use more then 254 IDs.

If we ever make use of stable-type 255, we must extend
the encoding to allow for more values. The assertion
is there to catch that.
2017-01-09 14:50:33 +01:00
Thomas Haller
d8cefd57fb platform: add optional dirfd argument to sysctl functions
Still unused.
2016-12-13 11:26:58 +01:00
Thomas Haller
44ecb41593 build: don't add subdirectories to include search path but require qualified include
Keep the include paths clean and separate. We use directories to group source
files together. That makes sense (I guess), but then we should use this
grouping also when including files. Thus require to #include files with their
path relative to "src/".

Also, we build various artifacts from the "src/" tree. Instead of having
individual CFLAGS for each artifact in Makefile.am, the CFLAGS should be
unified. Previously, the CFLAGS for each artifact differ and are inconsistent
in which paths they add to the search path. Fix the inconsistency by just
don't add the paths at all.
2016-11-21 14:26:37 +01:00
Beniamino Galvani
35b32e5825 ndisc/lndp: fix unregistration of receive handler
Fixes: 6387856602
2016-11-12 19:25:40 +01:00
Lubomir Rintel
6387856602 ndisc/lndp: add ability to announce the managed IPv6 configuration
Announce the prefixes and DNS configuration.
2016-11-09 17:23:32 +01:00
Lubomir Rintel
425ce65ed0 ndisc: rename the config-changed signal
The ndisc config can now be changed by NMDevice as well when the NDisc
is in ROUTER mode. But what we're really interested in is when we
receive a new one from the outside.
2016-11-09 17:23:32 +01:00
Lubomir Rintel
87624a6c50 ndisc: add logic for acting as a router 2016-11-09 17:23:32 +01:00
Lubomir Rintel
be6a0c7ce5 ndisc: move the logging deduplication into a macro
We'll want to use it elsewhere.
2016-11-09 17:23:32 +01:00
Lubomir Rintel
aed2106d3e ndisc: avoid calling start() multiple times
It hooks on ndp event callbacks and we'll end up in them being done
redundantly, leaking them on dispose and potentially even calling them.
2016-11-09 17:23:31 +01:00
Lubomir Rintel
679f8dfc7d ndisc/trivial: move nm_ndisc_set_iid upwards 2016-11-09 17:23:31 +01:00
Lubomir Rintel
c84313a2b7 ndisc/lndp: drop an unused variable 2016-11-09 17:16:48 +01:00
Lubomir Rintel
d09aea62ee ndisc/trivial: add a couple of comments of where do the constants come from 2016-11-09 17:16:48 +01:00
Lubomir Rintel
44fca246a7 rdisc: rename to ndisc
We'll soon not only do the router discovery, but announce ourselves as a
reouter. "Neighbor discovery" sounds to be a more appropriate name for
the class than "Router discovery".
2016-11-09 17:16:47 +01:00