summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* gitlab-ci: regenerate imageslr/fix-debianLubomir Rintel2022-06-272-6/+6
|
* gitlab: fix Ubuntu 18.04 image creationLubomir Rintel2022-06-271-2/+17
| | | | Or, well, work around a bug.
* contrib/debian: rework package installLubomir Rintel2022-06-271-11/+36
| | | | | | | | | Apt is run for each package separately and errors are ignored. This is not great -- it's slow and ignores errors. Therefore we sometimes end up without packages we need. Let's tolerate errors only for packages that we are know can fail to install safely.
* platform: fix build with kernels < 5.7Lubomir Rintel2022-06-271-1/+3
| | | | | | Fixes: 919a61bc533a ('platform/netlink: extend nl_nlmsghdr_to_str() for genl messages') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1280
* merge branch 'th/misc'Thomas Haller2022-06-273-28/+26
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1278
| * ifcfg-rh: fix serializing lock route attributesThomas Haller2022-06-271-4/+5
| | | | | | | | | | The lock attribute is a boolean, it can also be FALSE. We need to handle that case, and don't add serialize "$NAME lock 0" for them.
| * ifcfg-rh: in get_route_attributes_string() check prefix for "lock" namesThomas Haller2022-06-271-1/+1
| | | | | | | | | | | | | | | | | | In practice, the profile probably validates, so all the attribute names are well-known. There is thus no attribute name that has "lock-" in the middle of the string. Still, fix it. We want to match only at the begin of the name.
| * core: log boot-id when NetworkManager startsThomas Haller2022-06-271-3/+4
| | | | | | | | | | | | | | | | | | | | | | In a logfile, the "is starting" message is an interesting point that indicates when NetworkManager is starting. Include also the boot-id in the log, so that we can know whether this was a restart from the same boot. Also drop the "for the first time" part. <info> [1656057181.8920] NetworkManager (version 1.39.7) is starting... (after a restart, asserts:10000, boot:486b1052-4bf8-48af-8f15-f3e85c3321f6)
| * glib-aux: make code in nm_uuid_is_valid_nm() clearerThomas Haller2022-06-241-15/+12
| | | | | | | | | | | | | | | | Setting `NM_SET_OUT(out_normalized, !is_normalized)` is correct, but looks odd and required a long code comment. Try to write the same code differently, I think it is easier to read and requires less comment to explain.
| * glib-aux: pass string length to nm_uuid_generate_from_string() in ↵Thomas Haller2022-06-241-5/+4
|/ | | | | | | nm_uuid_is_valid_nm() No need to recompute the length. We have it already. Also no need to NUL terminate the string.
* po: update Ukrainian (uk) translationYuri Chornoivan2022-06-241-551/+538
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1277
* merge: branch 'lr/ask-mode'Lubomir Rintel2022-06-243-104/+172
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1215
| * nmcli/connections: fix setting ifname with "--ask c add"lr/ask-modeLubomir Rintel2022-06-241-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We almost always do the wrong thing in interactive add: The software devices generally require an interactive name, but we don't insist of asking for them; treating them as optional: $ nmcli -a c add type dummy There is 1 optional setting for General settings. Do you want to provide it? (yes/no) [yes] For some interface types (bridges, bonds, ...) we make up a name, presumably for historical reasons. But we don't give the user an option to modify them: $ nmcli -a c add type bridge <not asking for interface name at all> There are 9 optional settings for Bridge device. Do you want to provide them? (yes/no) [yes] This fixes the above use cases -- still set the default, but be sure to ask: $ nmcli -a c add type dummy Interface name: $ nmcli -a c add type bridge Interface name [nm-bridge1]: Beautiful.
| * nmcli/connections: make sure the connection has a base settingLubomir Rintel2022-06-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Do the same bookkeeping as would happen upon setting the "type" option when the connection has a connection.type set upon its addition. Otherwise the --ask mode is sad: $ nmcli --ask c add connection.type team ** nm:ERROR:src/nmcli/connections.c:5648:connection_get_base_meta_setting_type: assertion failed: (base_setting) Bail out! nm:ERROR:src/nmcli/connections.c:5648:connection_get_base_meta_setting_type: assertion failed: (base_setting) Aborted (core dumped)
| * nmcli/connections: factor out code run after new connection's type is setLubomir Rintel2022-06-241-21/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the connection's type is set, some bookkeeping is necessary for the interactive (--ask) mode: appropriate setting need to be added and options enabled. Currently it happens in an option setter; which runs when the "type" options is present on the command line, or the value is set in a response to interactive mode: $ nmcli --ask c add type team $ nmcli --ask c add Connection type: team But not when the property is set directly: $ nmcli --ask c add connection.type team ** nm:ERROR:src/nmcli/connections.c:5648:connection_get_base_meta_setting_type: assertion failed: (base_setting) Bail out! nm:ERROR:src/nmcli/connections.c:5648:connection_get_base_meta_setting_type: assertion failed: (base_setting) Aborted (core dumped) This doesn't fix the issue -- a followup commit (hopefully) will.
| * nmcli/connections: use the current value in default in ask_option()Lubomir Rintel2022-06-243-37/+57
| | | | | | | | | | | | | | | | | | | | | | For new connections, this ensures the value in square brackets on interactive add are always correct. Apart from that, this allows us to initialize some non-default values before asking (such as making up an interface name for some software devices), and inform the user about what we picked: Interface name [nm-bridge]:
| * nmcli/connections: don't ask to ask with --askLubomir Rintel2022-06-241-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | This is slightly annoying: $ nmcli -a c add type ethernet There is 1 optional setting for General settings. No point in asking if there's just one option. Just ask right away: $ nmcli -a c add type ethernet Interface name:
| * nmcli/connections: make sure the connection has a typeLubomir Rintel2022-06-241-3/+10
| | | | | | | | | | We use it before we validate the connection, thus need to check if it's actually there.
| * nmcli/connections: make enable_options() always enable an optionLubomir Rintel2022-06-241-10/+6
| |
| * nmcli/connections: make opts argument to enable_options() optionalLubomir Rintel2022-06-241-6/+15
| | | | | | | | | | This makes things slightly less annoying when dealing with options that map nicely to properties (unlike bridge options).
| * nmcli/connections: allow empty lists with "--ask c add"Lubomir Rintel2022-06-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The interactive add is not too enthusiastic about not providing a value in a list. That is before on getting an empty line in ask_option() we take a shortcut instead of dispatching to set_option(). That way we skip setting the PROPERTY_INF_FLAG_DISABLED flag, causing the option to be included in questionnaire_one_optional()'s info list. There's no reason to avoid calling set_option() if we don't get a value; set_option() handles NULL value just fine. $ nmcli -a c add Connection type: dummy There is 1 optional setting for General settings. Do you want to provide it? (yes/no) [yes] Interface name [*]: lala There are 2 optional settings for IPv4 protocol. Do you want to provide them? (yes/no) [yes] You can specify this option more than once. Press <Enter> when you're done. IPv4 address (IP[/plen]) [none]: You can specify this option more than once. Press <Enter> when you're done. IPv4 address (IP[/plen]) [none]: You can specify this option more than once. Press <Enter> when you're done. IPv4 address (IP[/plen]) [none]: ...
| * nmcli/connections: do not remove a bond option unless reset is allowedLubomir Rintel2022-06-241-17/+15
| | | | | | | | | | If we're setting an option with no value given and no reset allowed, let's just set the default value.
| * nmcli/connections: pass allow_reset to check_and_set() callbackLubomir Rintel2022-06-241-1/+16
| | | | | | | | | | Like the regular set_option() handler, the special ones also need to know whether to reset an option or keep the value.
| * libnmc-setting: fix default suggestions for some optionsLubomir Rintel2022-06-241-2/+2
| | | | | | | | These are just plain wrong.
* | po: update Ukrainian translationYuri Chornoivan2022-06-241-199/+269
| | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1275
* | core: avoid stale entries in the DNS manager for non-virtual devicesbg/cleanup-dns-for-removedBeniamino Galvani2022-06-241-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | _dev_l3_register_l3cds() schedules a commit, but if the device has commit type NONE, that doesn't emit a l3cd-changed. Do it manually, to ensure that entries are removed from the DNS manager. Related: b86388bef375 ('core: avoid stale entries in the DNS manager') Fixes: 58287cbcc0c8 ('core: rework IP configuration in NetworkManager using layer 3 configuration') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/995 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1268
* | platform: merge branch 'th/platform-genl-2'Thomas Haller2022-06-244-341/+389
|\ \ | |/ |/| | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1270
| * platform/netlink: expose genl_ctrl_policy policy in headerThomas Haller2022-06-242-11/+14
| |
| * platform/netlink: drop nl_socket_set_ext_ack() APIThomas Haller2022-06-243-20/+3
| | | | | | | | | | We just always want to set this. No need for a setter that is only called once.
| * platform/netlink: simplify socket flags and use boolean fieldsThomas Haller2022-06-243-21/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - replace "s_flags" field by explicit boolean fields. - "s_msg_peek" now is simplified. Previously, we would default to peek, unless the user caller nl_socket_disable_msg_peek() or set nl_socket_set_msg_buf_size(). Simplify that. We now default to peek, unless NL_SOCKET_FLAGS_DISABLE_MSG_PEEK is set. We have no callers that call nl_socket_set_msg_buf_size(), so we can simplify that logic and just enable peeking by default. - keep "s_auto_ack" field, although it is always TRUE and there is no API to toggle that. However, it is kept as a self-documenting thing, so we would know the relevant places where auto-ack matters. - drop nl_socket_disable_msg_peek(). We have no caller of this function and we can set peeking in nl_socket_new(). We also don't need to change it after creation of the socket.
| * platform/netlink: add flags argument to nl_socket_new()Thomas Haller2022-06-243-17/+47
| | | | | | | | | | | | | | | | | | | | | | The real purpose is that we set the socket options before bind(). For that, we need to be able to specify the flag during nl_socket_new(). Another reason is that these are common questions to ponder while creating a netlink socket. There shouldn't be several setter functions, just specify the flag right away. These parameters are not going to change afterwards (at least, we don't need/use that and we don't have API for that either).
| * platform/netlink: extend nl_nlmsghdr_to_str() for genl messagesThomas Haller2022-06-243-82/+93
| | | | | | | | | | | | | | | | Print more details for generic netlink messages. Also, pass the group that we obtained via NETLINK_PKTINFO. Also, factor out simple to-string methods.
| * platform/netlink: add reading NETLINK_PKTINFO in nl_recv()Thomas Haller2022-06-243-45/+69
| | | | | | | | | | | | | | | | We will need this, for getting nl_pktinfo control messages that contain the extended destination group number. Also, drop NL_SOCK_PASSCRED. It was only used to not iterate over the control messages, but doing that should be cheap.
| * platform/netlink: minor cleanup in _netlink_recv_handle()Thomas Haller2022-06-241-14/+9
| | | | | | | | | | | | - drop "abort_parsing" variable, it was redundant. - rename event_valid_msg(), as this is about NETLINK_ROUTE. - rename "err" variable to "retval".
| * platform/netlink: move generic code in _netlink_recv_handle()Thomas Haller2022-06-241-71/+69
| | | | | | | | This also applies to genl messages. Move the code.
| * platform/netlink: add nl_msg_lite struct to avoid allocating netlink messageThomas Haller2022-06-242-39/+60
| | | | | | | | | | | | | | | | | | | | | | | | There really is no need for two(!) heap allocations while parsing the netlink message. We already have it in the buffer. Just use it. Note that netlink attributes need to be aligned to 4 bytes. But nlmsg_next() already ensures that, so not even for alignment purpose we need to clone the message. Create a new "struct nl_msg_lite" that can hold pointers to everything we need.
| * platform/netlink: add const modifier for genl functionsThomas Haller2022-06-242-23/+23
| |
| * platform/netlink: add const modifier to netlink header pointersThomas Haller2022-06-233-12/+12
| | | | | | | | They are not supposed to be modified.
| * platform/netlink: add "rxbuf/txbuf" arguments to nl_socket_new()Thomas Haller2022-06-233-8/+6
| |
| * platform/netlink: add "blocking" argument to nl_socket_new()Thomas Haller2022-06-233-8/+5
|/ | | | | | Whether we use a socket blockingly or non-blocking is usually determined upfront and does not change. Make it a parameter of nl_socket_new(). Also, it saves an additional syscall.
* connectivity: skip unexpected address families in system_resolver_resolve_cb()Thomas Haller2022-06-231-2/+2
| | | | | This actually cannot happen, because GInetAddress is either IPv4 or IPv6. Still.
* nmcli/devices: fix a crashLubomir Rintel2022-06-231-2/+2
| | | | | | | | | This is not good: $ nmcli device delete nm-bond Segmentation fault (core dumped) Fixes: 5f9d2927ed02 ("nmcli/devices: use GPtrArray from get_device_list() directly")
* merge: branch 'lr/nmcli-checkpoint'Lubomir Rintel2022-06-235-92/+404
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1207
| * nmcli/devices: add "checkpoint" commandlr/nmcli-checkpointLubomir Rintel2022-06-153-3/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an interface to the Checkpoint/Restore functionality that's available for quite some time. It runs a command with a checkpoint taken and rolls back unless success is confirmed before the checkpoint times out: $ nmcli dev checkpoint eth0 -- nmcli dev dis eth0 Device 'eth0' successfully disconnected. Type "Yes" to commit the changes: No Checkpoint was removed. The details about how it's used are documented in nmcli(1) and nmcli-examples(7).
| * nmcli: be less insistant on exiting when readline() gets no inputLubomir Rintel2022-06-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | When the input ends, we indeed eventually want to shut down. Nevertheless, it might be that we terminated the input *because* we're already shutting down and want do do our cleanup. Let's not take the shortcut to nmc_exit() in case the main loop is no longer running. This doesn't affect existing uses of nmc_readline(), but will be useful in a future patch.
| * nmcli/devices: use GPtrArray from get_device_list() directlyLubomir Rintel2022-06-151-32/+23
| | | | | | | | | | | | | | | | | | This makes get_device_list() return an array of NMDevices with a reference taken and a destroy notifier that unhooks disconnect_state_cb, so that it could replace the GSList of the same utility used by disconnect/delete commands. Suggested-by: Thomas Haller <thaller@redhat.com>
| * nmcli/devices: return GPtrArray instead of GSList from get_device_list()Lubomir Rintel2022-06-151-43/+35
| | | | | | | | | | | | | | | | | | | | | | A pointer array is slightly more efficient here, since we don't really need the ability to insert elements in the middle. In fact, we'd prefer if we could just add to the end, so that we'd spare some callers from a need to do a g_slist_reverse(). Even though that alone being a good reason to use a GPtrArray instead of GSList, I'm doing this for so that I could actually use the returned value as-is in a call to nm_client_checkpoint_create() in a future patch.
| * nmcli/devices: make get_device_list() terminate on "--"Lubomir Rintel2022-06-151-0/+22
| | | | | | | | | | | | | | | | Don't consider "--" a device name. Instead, treat it as a signal to stop reading the device list. If a caller expects nothing beyond the device names, it now has to check.
| * nmcli/devices: make get_device_list() shift argc/argvLubomir Rintel2022-06-151-25/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this patch, get_device_list() would give the caller no clue about how many options did it consume. That is okay -- it would always process all argument until the end, so the no callers would really care. In a further patch, I'd like to allow termination of the device name list (with a "--" arguments), so it will be possible to specify further arguments. Let's change the protype of this routine to use pointers to argc/argv, that it will be possible to adjust them.
| * glib-aux: add g_ptr_array_find() compat routineLubomir Rintel2022-06-151-0/+27
| | | | | | | | I want it but GLib is no good. Sad.