summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ovs: avoid ovs error when same MAC is set on a local interface and bridgebg/rh1899745Beniamino Galvani2020-11-261-5/+21
| | | | | | | | | | | | | | | If the same MAC address is set on both the bridge connection and the interface connection, and the interface is local, NM currently sets the hwaddr record in both Bridge and Interface ovsdb tables. As a result, ovs complains with error: bridge|ERR|interface br0: ignoring mac in Interface record (use Bridge record to set local port's mac) Avoid this error: if the bridge and interface MACs are the same, just set the address in the Bridge table; if they are different, give a more detailed warning and ignore the interface MAC. https://bugzilla.redhat.com/show_bug.cgi?id=1899745
* ovs: rename variableBeniamino Galvani2020-11-261-9/+9
| | | | | @interface_is_internal is a bad name. The variable indicates whether the interface is the local interface.
* initrd: fix parsing of ip= arguments with empty first tokenbg/initrd-ip-empty-rh1900260Beniamino Galvani2020-11-262-11/+140
| | | | | | | | | | | | | | | | | | | | | | | | | The parser checks if the first token of an ip= argument is an IP address to determine which of the two possible syntaxes is used: ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]] ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<mtu>][:<macaddr>]] This works as long as the first token is not empty, which - according to the dracut.cmdline man page - seems to be guaranteed. However, the network-legacy dracut plugin accepts an empty interface or client IP. Also, if a user needs DHCP and wants to specify a hostname, the only possible syntax is: ip=::::<hostname>::dhcp Change the parser to check the second token instead, similarly to what the network-legacy module does [1]. [1] https://github.com/dracutdevs/dracut/blob/050/modules.d/40network/net-lib.sh#L490 https://bugzilla.redhat.com/show_bug.cgi?id=1900260 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/693
* trivial: fix coding styleThomas Haller2020-11-241-2/+1
|
* gitlab-ci: add CentOS 7.9 and 8.2 imagesThomas Haller2020-11-242-4/+66
|
* dns: fix setting systemd-resolved name servers for default routeBeniamino Galvani2020-11-241-1/+2
| | | | | | | If the interface is the DNS default route but has no domain, its name servers were not sent to systemd-resolved. Fix this. Fixes: ee9fab03613e ('dns: fix handling default routing domains with systemd-resolved')
* scripts: allow marking commits with "Ignore-Backport:" in "find-backports" ↵Thomas Haller2020-11-241-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | script "find-backports" searches commit messages of upstream branches for "Fixes:" comments. Those will then be highlighted to be backported, if the script determines that to be necessary. "find-backports" also honors the "cherry picked from" comments, to detect when a patch was already backported. That is thus a way to suppress reporting a commit to be backported. Add another way to flag commits so they don't need backporting. Via "Ignore-Backport:" tag. As "find-backports" also honors "refs/notes/bugs" notes, this can be used like: git notes \ --ref refs/notes/bugs \ append \ -m "Ignore-Backport: e""29f00fa0c69 ('NEWS: fix entry that is targeted for 1.30 instead of 1.28')" \ 2''3364aa8f3bd6b11e2ac9e30117eaabfe1f3a9f2
* NEWS: move entry that was backported to 1.28Beniamino Galvani2020-11-241-4/+4
|
* dns: merge branch 'th/ip-config-cleanups' into masterThomas Haller2020-11-2413-258/+318
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/689
| * dns/trivial: rename NMDnsIPConfigData to NMDnsConfigIPDataThomas Haller2020-11-245-94/+104
| | | | | | | | | | | | | | | | Let's try to rework and improve the implementation. The code is already rather complicated from the start. Let's first try to use consistent names for things. Naming is very important, so that they follow a pattern that tells you what something does.
| * dns: allow sorting of NMDnsConfigDataThomas Haller2020-11-242-3/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We will rework preparing the DNS data, so that we do things that currently "nm-dns-systemd-resolved.c" does (see InterfaceConfig). We thus will need to access the NMDnsConfigData, which is per-ifindex. As such, it is useful to have NMDnsConfigData in a stable order, sorted by ifindex. As we track NMDnsConfigData in a hash table, we need to do the sorting outside of that. There are many ways to achive that. The solution here is to let NMDnsConfigData also be tracked by a CList. We only need to resort the list, when we add a new ifindex -- which should happen only seldom. The advantage is that the sorting happens in-place and can expose it to other uses (by providing them access to the CList head).
| * core: add nm_ip_config_is_ipv4() for dispatching NMIP[46]Config operationsThomas Haller2020-11-241-21/+21
| | | | | | | | | | | | | | "NM_IP_CONFIG_GET_CLASS(config)->is_ipv4" only follows a pointer (except additional assertions in debug builds). It's thus more efficient than NM_IS_IP4_CONFIG(), which needs to compare GType and call nm_ip4_config_get_type().
| * core: use nm_ip_config_iter_ip_route_for_each() in ↵Thomas Haller2020-11-241-18/+8
| | | | | | | | _get_route_table_sync_mode_stateful()
| * core: use nm_ip_config_iter_ip_address_for_each() in "nm-pacrunner-manager.c"Thomas Haller2020-11-241-44/+19
| |
| * dns: unify IPv4/IPv6 in get_ip_rdns_domains()Thomas Haller2020-11-241-26/+18
| |
| * core: add nm_utils_get_reverse_dns_domains_ip() helperThomas Haller2020-11-241-0/+12
| |
| * core/trivial: rename nm_utils_get_reverse_dns_domains_ip*() functionsThomas Haller2020-11-244-23/+23
| | | | | | | | | | | | | | | | Let's add a nm_utils_get_reverse_dns_domains_ip() function, which can operate on both address families. We frequently do that, but then our address family specific functions tend to have an underscore in the name. Rename.
| * core: add nm_ip_config_iter_ip_address_for_each() macroThomas Haller2020-11-242-0/+32
| |
| * platform: rework nm_platform_dedup_multi_iter_next_*() and add more ↵Thomas Haller2020-11-241-46/+58
|/ | | | | | | | | | | | | | | | | | | implementations I want to add more such accessors, because they are the base for the corresponding for-each macros. Add a helper macro _nm_platform_dedup_multi_iter_next() to do that, which should make it simpler to add these nm_platform_dedup_multi_iter_next*() functions. Note that previously these functions were inline functions, now they are macros. I think there is very little difference here. Also before those functions could be entirely inlined. By using the macro the result doesn't really change. One difference is that we now require an "out" pointer. Previously that was not required, but I guess it makes little sense otherwise.
* core: fix modifying connection during recheck_assume_connection()Thomas Haller2020-11-241-2/+7
| | | | | | | | | | | | | | | | Since commit d35d3c468a30 ('settings: rework tracking settings connections and settings plugins') must settings connections not be modified. They must be treated immutable and only updated by replacing them with a new variant. There is even an assertion for that. Fix the code that attempts to modify an existing NMConnection. https://bugzilla.redhat.com/show_bug.cgi?id=1900536 Fixes: f2fe6c03ee3f ('manager: don't treat the initramfs-configured DHCP connections as generated') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/690
* build/meson: fix build to always set "-W" compiler flagsThomas Haller2020-11-231-62/+57
| | | | | | | | | | | | | | | | We must set these compiler flags independent as to whether this is a release build or a debug build. In most cases, we don't differentiate between release and debug build anyway. Granted, we have "-D more_asserts=100" and set "-O" CFLAGS, but that is more granular and not a simple "buildtype". In particular, these compiler flags apply to all kinds of builds. This is important, because otherwise we get build failures, because also in release build we want to build with `-Werror` and `-Wall`. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/692
* gitignore: ignore "/docs/libnm/libnm.actions"Thomas Haller2020-11-231-0/+1
| | | | Dunno why this file now gets generated.
* Revert "dns: change default DNS priority of VPNs to -50"Thomas Haller2020-11-235-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert this change. One problem is that none of the current GUIs (nm-connection-editor, gnome-control-center, plasma-nm) expose the dns-priority option. So, users tend to have their profile value set to 0. Changing the default means for them not only a change in behavior, but its hard to fix via the GUI. Also, what other call DNS leaks, is Split DNS to some. Both uses make sense, but have conflicting goals. The default cannot accommodate both at the same time. Also, with split DNS enabled (dnsmasq, systemd-resolved), the concern for DNS leaks is smaller. Imagine: Wi-Fi profile with ipv4.dns-priority (effectively) 100, domain "example.com". VPN profile with ipv4.dns-priority (effectively) 50 and a default route. That is a common setup that one gets by default (and what probably many users have today). In such a case with split DNS enabled, the Wi-Fi's DNS server only sees requests for "*.example.com". So, it does not leak everything. Hence, revert this change before 1.28.0 release to the earlier behavior. This reverts commit af13081bec8bf5cbe961df4c4577a7e4c7b14e97. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/688
* dns: fix accessing NULL domains.reverse array in rebuild_domain_lists()Thomas Haller2020-11-201-1/+2
| | | | Fixes: fbf1683c1a75 ('dns: more debug logging for DNS settings in rebuild_domain_lists()')
* trivial: fix coding styleThomas Haller2020-11-202-2/+3
|
* dns: merge branch 'th/dns-resolved-fix-exclusive'Thomas Haller2020-11-204-76/+238
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/687
| * dns: set first Domains/DefaultRoute in systemd-resolved before DNSThomas Haller2020-11-201-1/+1
| |
| * dns: more debug logging for DNS settings in rebuild_domain_lists()Thomas Haller2020-11-201-0/+15
| |
| * dns: fix handling default routing domains with systemd-resolvedThomas Haller2020-11-204-45/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to set "~." domains for all devices that should be used for resolving unknown domains. Systemd-resolved also supports setting "SetLinkDefaultRoute()". We should only set the wildcard domain if we want that this interface is used exclusively. Otherwise, we should only set DefaultRoute. See ([1], [2], [3], [4]). Otherwise the bad effect is if other components (wg-quick) want to set exclusive DNS lookups on their link. That is achieved by explicitly adding "~." and that is also what resolved's `/usr/sbin/resolvconf -x` does. If NetworkManager sets "~." for interfaces that are not important and should not be used exclusively, then this steals the DNS requests from those external components. In NetworkManager we know whether a link should get exclusive lookups based on the "ipv[46].dns-priority" setting. [1] https://www.freedesktop.org/software/systemd/man/org.freedesktop.resolve1.html [2] https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html [3] https://github.com/systemd/systemd/issues/17529#issuecomment-730522444 [4] https://github.com/systemd/systemd/pull/17678
| * dns: assert domains are unset at start of rebuild_domain_lists()Thomas Haller2020-11-201-4/+14
| |
| * dns: assert that priorities in rebuild_domain_lists() are increasingThomas Haller2020-11-201-0/+4
| | | | | | | | | | This is nm_assert(). The compiler should be able to completely eliminate this code in production.
| * dns: cleanup handling of shadowed priorities rebuild_domain_lists()Thomas Haller2020-11-201-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | domain_is_shadowed() only works, because we pre-sort all items. When we call domain_is_shadowed(), then "priority" must be not smaller than any priority already in the dictionary. Let's add an nm_assert() for that. While at it, I also found it ugly to rely on GPOINTER_TO_INT(g_hash_table_lookup(ht, domain)) returning zero to know whether the domain is tracked. While more cumbersome, we should check whether the value is in the hash (and not). Not whether the value does not translate to zero. Add domain_ht_get_priority() for that.
| * dns: track NMDnsConfigData as keys of a dictionaryThomas Haller2020-11-202-6/+9
| | | | | | | | | | | | | | There is unnecessary overhead of tracking a separate key and value in a GHashTable. Use g_hash_table_add().
| * dns: cleanup allocation of NMDnsConfigData and NMDnsIPConfigDataThomas Haller2020-11-201-10/+14
|/
* libnm: improve error message of nm_keyfile_write() for invalid profilesThomas Haller2020-11-201-2/+27
|
* initrd: merge branch 'bg/initrd-vlan'Beniamino Galvani2020-11-204-39/+317
|\ | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1898294 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/581 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/509 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/685
| * initrd: disable ipv4 and ipv6 by default for vlan parent connectionbg/initrd-vlanBeniamino Galvani2020-11-202-4/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the generator to disable by default IP configuration for the parent connection of a VLAN, because that is what a user would expect and what the legacy module does. Of course if the user explicitly configures DHCP or an address for the parent interface, that overrides the default. Note that now the generator always creates a connection for the parent interface. Before this commit, it did only when there was an explicit ip= argument for the parent interface. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/509
| * initrd: fix parsing of ip= argument with dotted interface nameBeniamino Galvani2020-11-204-34/+82
| | | | | | | | | | | | | | | | | | | | | | | | The command line parser looks for a dot or a colon to determine whether the first token in a ip= argument is a IPv4 address (dot), an IPv6 address (colon) or an interface name (none). This strategy doesn't work for interface names containing a dot (typically VLANs). Instead, try to parse the IPv4/IPv6 address in the token; if this fails then consider the token as an interface name. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/581
| * initrd: add test for prefixed address in ip= argumentBeniamino Galvani2020-11-201-2/+4
|/
* wifi: merge branch 'th/wifi-bssid-cleanup'Thomas Haller2020-11-2020-157/+150
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/686
| * core: refactor nm_ethernet_address_is_valid()th/wifi-bssid-cleanupThomas Haller2020-11-195-49/+40
| | | | | | | | | | | | | | | | | | | | The caller *always* needs to know whether the argument is an address in binary or text from. At that point, it's only inconvenient to require the user to either pass "-1" or ETH_ALEN as size (nothing else was supported anyway). Split the function and rename.
| * wifi: use NMEtherAddr struct for bssidThomas Haller2020-11-1914-81/+83
| |
| * wifi: drop Wext handlers get_rate()/get_bssid()/get_qual() from NMWifiUtilsClassThomas Haller2020-11-193-39/+31
| | | | | | | | | | | | | | | | | | Wext is anyway deprected. Our NMWifiUtilsClass should not have API to accomodate it. That means, we don't need dedicated get_rate(), get_bssid(), get_qual() hooks, when they all are only called by get_station(). Instead, push the Wext specific code down.
| * wifi: use nm_wifi_ap_set_address_bin() in activation_success_handler()Thomas Haller2020-11-192-8/+3
| |
| * wifi: expose nm_wifi_ap_set_address_bin() helperThomas Haller2020-11-192-17/+18
| |
| * shared: add static asserts for size/alignment of NMEtherAddrThomas Haller2020-11-191-0/+3
| |
| * shared: improve NM_ETHER_ADDR_INIT() helper macroThomas Haller2020-11-192-4/+13
|/ | | | | | | | | | | | | | | The macro should require exactly 6 parameters (for the 6 bytes of the address). On the other hand, we also should be able to use a macro like NM_ETHER_ADDR_INIT(NM_BRIDGE_GROUP_ADDRESS_DEF_BIN) To get that work properly, we need to expand the variadic macro once. Also, cast the result to the struct type. With this, it can not only be used for initialization, but also for assignment and temporary variables.
* trivial: improve code commentsin "nm-std-aux/c-list-util.c"Thomas Haller2020-11-191-2/+3
|
* wifi: merge branch 'balrog-kun:platform-wifi-common-call'Thomas Haller2020-11-199-162/+143
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/683
| * platform: Drop nm_platform_wifi_get_{bssid,rate,quality}Andrew Zaborowski2020-11-196-154/+9
| | | | | | | | | | | | | | | | | | | | | | These are unused now so remove them and revert most of e0394689b3463a1c0c7b0f162bb08327fca8e6f4 which attempted to fix the same issue of the platform wifi API not mapping well the nl80211 commands resulting in redundant netlink commands being used. In the wext driver there are still three individual getters for the three values and nm_wifi_utils_get_station() uses either these or the collective get_station method depending on the driver.