summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libnm: add NMSettingWired:offload-featureth/ethtool-options-rh1335409Thomas Haller2018-07-163-0/+67
|
* xxxThomas Haller2018-07-161-0/+107
|
* platform/mii: use SocketHandle also for nmp_utils_mii_supports_carrier_detect()Thomas Haller2018-07-161-16/+12
| | | | | | There is little difference in practice because there is only one caller. Still re-use the SocketHandle also for mii. If only, to make it clear that SocketHandle is not only suitable for ethtool, but also mii.
* fixup! platform/ethtool: add SocketHandle to reuse socket for ethtool requestsThomas Haller2018-07-161-18/+20
|
* platform/ethtool: add SocketHandle to reuse socket for ethtool requestsThomas Haller2018-07-161-74/+120
| | | | | | | | | | | | | | | | | Previously, each call to ethtool_get() would resolve the ifindex and create a new socket for the ethtool request. This is partly done, because ethtool only supports making requests by name. Since interfaces can be renamed, this is inherrently racy. So, we want to fetch the latest name shortly before making the request. Some functions like nmp_utils_ethtool_supports_vlans() require multiple ioctls. And next, we will introduce more ethtool functions, that make an even larger number of individual requests. Add a simple SocketHandle struct, to create the socket once and reuse it for multiple requests. This is still entirely internal API in "nm-platform-utils.c".
* platform/ethtool: split functions for ETHTOOL_GSTRINGSThomas Haller2018-07-161-39/+60
|
* platform: merge 'jbeta:wireguard-genl-family-lifetime'Thomas Haller2018-07-132-6/+6
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/161
| * platform: put wireguard_family_id in NMPObjectLinkJavier Arteaga2018-07-132-6/+6
| | | | | | | | | | | | | | Limit the lifetime of the cached genl family ID to the lifetime of the interface so we correctly handle module reloads. https://github.com/NetworkManager/NetworkManager/pull/161
* | wifi/ifd: Allow D-Bus activation to launch iwdJan Alexander Steffens (heftig)2018-07-131-1/+1
|/ | | | | | | iwd does not ship activation configuration yet; until then we simply fail the way we already do. https://bugzilla.gnome.org/show_bug.cgi?id=796805
* checkpatch: fix perldoc headingJavier Arteaga2018-07-121-1/+1
| | | | | | The script does not actually emulate a serial modem (yet). https://github.com/NetworkManager/NetworkManager/pull/165
* po: update Ukrainian (uk) translation (bgo#796728)Yuri Chornoivan2018-07-121-2127/+2585
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=796728
* tests/trivial: rename ip4_addr_ne32() to ip4_addr_be32() in ↵Thomas Haller2018-07-111-7/+9
| | | | | | | | | | | | | | test-networkmanager-service.py The function is supposed to return the IPv4 address as 32 bit integer in network byte order (bit endian). The ip4_addr_ne32() name is confusing, because "ne" commonly stands for "native endianness". Compare also "unaligned.h" and unaligned_read_ne32(), which also stands for native endianness (host order), not network order (big endian). Rename.
* device: destroy pending acd-managers when the device disconnectsBeniamino Galvani2018-07-111-3/+2
| | | | | | | | | | | | | | | | | | | We previously kept any acd-manager running if the device was disconnected. It was possible to trigger a crash by setting a long dad-timeout and interrupting the activation request: nmcli con add type ethernet ifname eth0 con-name eth0+ ip4 1.2.3.4/32 nmcli con mod eth0+ ipv4.dad-timeout 10000 nmcli -w 2 con up eth0+ nmcli con down eth0+ After this, the n-acd timer would fire after 10 seconds and try to disconnect an already disconnected device, throwing the assertion: NetworkManager:ERROR:src/devices/nm-device.c:9845: activate_stage5_ip4_config_result: assertion failed: (req) Fixes: 28f6e8b4d2ae554042027cb7af261289eb07e1e4
* connectivity: downgrade verbosity of error loggingThomas Haller2018-07-111-3/+3
| | | | | | Such failures during connectivity checks, may happen frequently and due to external causes. Don't log with error level to avoid spamming the logfile.
* shared/gsystem-local-alloc: strongly type gs_* cleanup functionsThomas Haller2018-07-112-21/+40
| | | | | | | | | | | | | | | | | | | | | At various places, use the correct type for the pointer, this allows the compiler to be more helpful. For gs_free, gs_unref_object, and nm_auto_free, the pointer type is of course still 'void *'. This catches wrong uses like gs_strfreev char *wrong1 = NULL; gs_strfreev const char **wrong2 = NULL; gs_free_error GError **p_error = NULL; gs_unref_array GPtrArray *ptr_array = NULL; Note that long time ago we copied "gsystem-local-alloc.h" header from libgsystem library. Until now, we didn't apply any local modification to this file, to keep it in sync with upstream. However, upstream libgsystem is not maintained anymore, so there is no reason to stay in sync with upstream.
* merge: branch 'bg/sriov-vf-rh1555013'Beniamino Galvani2018-07-1146-164/+3193
|\ | | | | | | | | | | Add support for changing SR-IOV VF settings. https://bugzilla.redhat.com/show_bug.cgi?id=1555013
| * ifcfg-rh: SR-IOV supportBeniamino Galvani2018-07-119-0/+324
| |
| * device: configure SR-IOVBeniamino Galvani2018-07-114-3/+142
| |
| * platform: add support for changing VF attributesBeniamino Galvani2018-07-113-0/+230
| |
| * platform: allow setting drivers-autoprobe on SR-IOV PFsBeniamino Galvani2018-07-115-38/+69
| | | | | | | | | | It is possible to tell kernel not to automatically autoprobe drivers for VFs. This is useful, for example, if the VF must be used by a VM.
| * cli: add support for configuring SR-IOVBeniamino Galvani2018-07-114-1/+112
| |
| * libnm-core: add SR-IOV settingBeniamino Galvani2018-07-1119-1/+2109
| | | | | | | | Add a setting containing SR-IOV parameters.
| * libnm: introduce NMTernary enumBeniamino Galvani2018-07-112-0/+17
| | | | | | | | | | Add a new enum that can be used where we need a boolean value that can be overridden globally.
| * libnm-core: tc: fix indentation and typoBeniamino Galvani2018-07-112-5/+5
| |
| * ifcfg-rh: add missing NM-only annotationsBeniamino Galvani2018-07-113-4/+4
| | | | | | | | Add the (+) annotation to NM-only variables.
| * libnm-core: don't emit signal when clearing lists already emptyBeniamino Galvani2018-07-114-16/+34
| | | | | | | | | | If the property is a list and it is already empty, we should not emit a signal when it gets cleared.
| * ifcfg-rh: add @match_key_type argument to svGetKeys()Beniamino Galvani2018-07-113-63/+68
| | | | | | | | Add a @match_key_type to svGetKeys() to filter the keys to be returned.
| * nm-utils: add _nm_utils_format_variant_attributes_full()Beniamino Galvani2018-07-112-33/+53
| |
| * shared: add nm_auto_vfree macroThomas Haller2018-07-111-0/+17
| | | | | | | | | | | | | | | | This really is the same as gs_strfreev / g_strfreev(). However, the difference is, that the former has the notion of freeing strv arrays (char **), while this in general frees an array of pointers. Implementation-wise, they are the same.
| * shared: add nm_hash_val() macroThomas Haller2018-07-111-0/+9
|/ | | | A helper macro, to combine the steps for hashing one value.
* all: merge branch 'th/style-fixes-int-types'Thomas Haller2018-07-11145-593/+601
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/164
| * all: don't use gchar/gshort/gint/glong but C typesThomas Haller2018-07-11143-587/+587
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We commonly don't use the glib typedefs for char/short/int/long, but their C types directly. $ git grep '\<g\(char\|short\|int\|long\|float\|double\)\>' | wc -l 587 $ git grep '\<\(char\|short\|int\|long\|float\|double\)\>' | wc -l 21114 One could argue that using the glib typedefs is preferable in public API (of our glib based libnm library) or where it clearly is related to glib, like during g_object_set (obj, PROPERTY, (gint) value, NULL); However, that argument does not seem strong, because in practice we don't follow that argument today, and seldomly use the glib typedefs. Also, the style guide for this would be hard to formalize, because "using them where clearly related to a glib" is a very loose suggestion. Also note that glib typedefs will always just be typedefs of the underlying C types. There is no danger of glib changing the meaning of these typedefs (because that would be a major API break of glib). A simple style guide is instead: don't use these typedefs. No manual actions, I only ran the bash script: FILES=($(git ls-files '*.[hc]')) sed -i \ -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>\( [^ ]\)/\1\2/g' \ -e 's/\<g\(char\|short\|int\|long\|float\|double\)\> /\1 /g' \ -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>/\1/g' \ "${FILES[@]}"
| * checkpatch: skip foreign codeLubomir Rintel2018-07-111-0/+4
| |
| * checkpatch: add a licensing hintLubomir Rintel2018-07-111-0/+1
| |
| * checkpatch: reset line counter on next fileLubomir Rintel2018-07-111-0/+1
| |
| * checkpatch: check against using "unsigned int" and "$INT_TYPE unsigned|signed"Thomas Haller2018-07-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Don't use the integer type before signed/unsigned, but the other way around. That is, unsigned long var; instead of long unsigned var; Also, just use "unsigned" instead of "unsigned int".
| * checkpatch: skip over generated files from glib-mkenumsThomas Haller2018-07-111-0/+1
| |
| * checkpatch: warn about non-leading tabsThomas Haller2018-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tabs are not only wrong after a space, they are always wrong if they don't appear at the beginning of a line. That would happen usually, when trying to align multiple lines like enum { VALUE1 = 1; OTHER_VALUE = 2; }; When doing that, the alignment will only be correct, if the reader later uses the same tab-width. Note that in NetworkManager we recommend the tab-width to be 4 characters, but with our "smart tab" indentation style, it wouldn't actually matter and the reader is free to choose any other tab-width -- as long as we don't use non-leading tabs. Don't allow non-leading tabs.
| * checkpatch: warn about using glib typedefs like gchar or gintThomas Haller2018-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | We should not use glib typedefs for basic C types char, short, int, long, float or double. We commonly do not use them, so enforce consistency. That is not true for typedefs like guint, which we commonly use because it's shorter typing than "unsigned int" (or "int unsigned" or "unsigned"). Whether or not to use guint is left undecided at this point.
| * generate-setting-docs.py: remove unreachable code in get_default_value()Thomas Haller2018-07-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_prop_type() cannot ever return "gchar", because it only returns values from "dbus_type_name_map" or for enums it has the form "%s (%s)" % (pspec.value_type.name, prop_type) Another reason why get_prop_type() cannot ever return a "char" type, is because of what get_prop_type() does. get_prop_type() only returns types based on the D-Bus type of the property, and on D-Bus there is no fundamental type for a one-character string. There is either a (UTF-8 encoded) string, or integer values of varying sizes. But in terms of unicode, a 'char' type makes little sense on D-Bus. And neither does it for get_prop_type().
| * generate-setting-docs.py: remove unused propxml argument from get_prop_type()Thomas Haller2018-07-111-3/+3
|/
* setting-connection: fix ovs-port parent setting verificationLubomir Rintel2018-07-101-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | $ nmcli c add type ovs-port ifname ovsport0 Error: Failed to add 'ovs-port-ovsport0' connection: connection.type: Only 'ovs-port' connections can be enslaved to 'ovs-bridge' nm_streq0() is not good here. It fails (with a wrong error message) even when the slave_type is not set, which it shouldn't since slave_type can be normalized. The real problem is the lack of the master property. This fixes the condition: $ nmcli c add type ovs-port ifname ovsport0 Error: Failed to add 'ovs-port-ovsport0' connection: connection.master: A connection with a 'ovs-port' setting must have a master. Corrects the error message: $ nmcli c add con-name br0 type bridge $ nmcli c add type ovs-port ifname ovsport0 parent br0 Error: Failed to add 'bridge-slave-ovsport0' connection: connection.slave-type: 'ovs-port' connections must be enslaved to 'ovs-bridge', not 'bridge' And gets rid of a confusing nm_streq0 use when comparing the type, since at that point type must not be NULL anymore. Fixes: 4199c976dac21c22773e0c133c42c3b738ca76d2
* contrib/checkpatch: print the actual source name instead of patch nameLubomir Rintel2018-07-101-10/+16
| | | | | | | This gives more relevant output in a commit check. Include a couple of small fixes trivial enough not to deserve a separate commit.
* merge: branch 'lr/ovs-slaves'Lubomir Rintel2018-07-1016-16/+213
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/155
| * libnm: add accessors for ovs port/bridge slaveslr/ovs-slavesLubomir Rintel2018-07-104-4/+174
| |
| * devices/ovs: expose slaves on D-Bus for OVS bridges and portsLubomir Rintel2018-07-105-1/+28
| |
| * all/trivial: grammar fixLubomir Rintel2018-07-107-11/+11
|/
* contrib: add checkpatch.plLubomir Rintel2018-07-101-0/+224
| | | | | | | | | | | | | | A naive code compliance checker. Invoke directly: contrib/scripts/checkpatch.pl 0001-switch-comments-to-klingon.patch contrib/scripts/checkpatch.pl hello.[ch] world.c Use from a commit hook: echo 'git format-patch --stdout -1 |contrib/scripts/checkpatch.pl || :>' \ >.git/hooks/post-commit Or view the documentation with "perldoc contrib/scripts/checkpatch.pl"
* shared: merge branch 'th/shared-glib-compat'Thomas Haller2018-07-092-1/+444
|\
| * shared: ensure "nm-glib.h" is not used without "nm-macros-internal.h"Thomas Haller2018-07-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note how "nm-glib.h" uses _nm_printf() macro, which is defined in "nm-macros-internal.h". There are many ways how to solve that problem. For example, we could define certain _nm_*() macros in "nm-glib.h" itself. However, that is a bit awkward, because optimally "nm-glib.h" only provides functions that are strictly related to glib compatiblity. _nm_printf() is used by "nm-glib.h" for its own implementation, it should not provide (or reimplement) this macro. We solve this instead by enforcing what NetworkManager already does. NetworkManager never includes "nm-glib.h" directly, instead "nm-macros-internal.h" is the only place that includes the glib compat header. It means, you cannot use "nm-glib.h" without "nm-macros-internal.h". But that is a reasonable compromise, with respect to granularity. The granularity at the moment is: if you use anything from "shared/nm-utils", you almost always need at least "nm-macros-internal.h" header (and automatically also get "nm-glib.h" and "gsystem-local-alloc.h"). It's not intended, to use "nm-glib.h" directly. This makes "nm-glib.h" an implementation detail of "nm-macros-internal.h" and it only exists to separate code that is related to glib compatibility to its own header.