Add NM dhcp settings to network model#2189
Conversation
| pub ip6_privacy: Option<i32>, | ||
| } | ||
|
|
||
| #[skip_serializing_none] |
There was a problem hiding this comment.
Not checked deeply but I guess we should skip serializing it in general if it is the default...
that is, default send_hostname and unset client_id and iaid.
There was a problem hiding this comment.
I think for the model it isn't as important as for e.g. the settings. I was basing client_id etc. mostly on MacAddress which also isn't skipped if unset. But if you prefer it not being serialized, I'm not against it.
|
It is already quite useful as we probably will need to expose these settings too, we were already planning to add the per connection hostname dhcp settings at least. |
1f300c4 to
0160503
Compare
| } | ||
|
|
||
| if let Some(dhcp4_settings) = &ip_config.dhcp4_settings { | ||
| ipv4_dbus.insert("dhcp-send-hostname", dhcp4_settings.send_hostname.into()); |
There was a problem hiding this comment.
I've just noticed that recent NM versions transitioned to a new property dhcp-send-hostname-v2 for NM > 1.52 (which isn't in SLFO yet, only Factory). I would of course like to adopt this new property as early as possible, but what is agama's requirement when it comes to NM compatability?
https://networkmanager.dev/docs/api/latest/settings-ipv4.html (see dhcp-send-hostname-v2 property docs)
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/51ea910cc223bab4c8fa489b192001cfc809e500 (relevant commit)
There was a problem hiding this comment.
Once it is available in both I guess we are fine adopting it. There could be a problem if the seleted product to be installed has a different NM version which does not support the option.
0160503 to
f0c7c60
Compare
f0c7c60 to
3a315a3
Compare
Prepare to release Agama 14: * #1994 * #2041 * #2103 * #2178 * #2189 * #2200 * #2205 * #2209 * #2212 * #2213 * #2214 * #2215 * #2216 * #2217 * #2219 * #2220 * #2224 * #2225 * #2226 * #2227 * #2228 * #2230 * #2231 * #2232 * #2233 * #2235 * #2237 * #2239 * #2241 * #2242 * #2244 * #2245 * #2246 * #2247 * #2248 * #2249 * #2250 * #2251 * #2252 * #2253 * #2254 * #2255 * #2256 * #2257 * #2259 * #2260 * #2262 * #2265 * #2266 * #2268 * #2269 * #2271 * #2272 * #2273 * #2275 * #2276 * #2278 * #2281
## Problem Agama doesn't detect and handle different NetworkManager versions. I know that currently this isn't an issue for agama itself, however I think it may become one in the future. Also for wicked2nm it represents a problem because when it is run on Leap15, it tries to send values that are not present due to the old NM version. See openSUSE/wicked2nm#24 ## Solution Parse NM version via the semver crate and then act accordingly when populating dbus values. I haven't checked all the values and when they were introduced, but I checked for Leap15 and also I mentioned in #2189 that `dhcp-send-hostname` is deprecated in favor of `dhcp-send-hostname-v2` ## Testing - *Added a new unit test* - *Tested manually* - *Tested with wicked2nm*
Problem
For the wicked2nm migration we require some additional dhcp settings, which are currently missing.
Solution
Add all the necessary values to the model. As these are pretty specific and unlikely to really be nedded by agama, I just added these to the network model and not the network settings and also took care that these shouldn't interfere in any way with the "normal" agama operation.
Testing