summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* platform: add network namespace support to platformth/platform-netnsThomas Haller2016-02-2012-67/+745
| | | | | | | Platform not only uses the netlink socket, but also sysfs, udev, ethtool, mii. To properly support network namespaces, we must switch the namespace as necessary. In case of udev, it is only supported on the main namespace.
* platform: call ethtool functions via platformThomas Haller2016-02-193-2/+24
| | | | | When adding namespace support, we must call ethtool from the proper namespace.
* macros: split macro NM_GOBJECT_PROPERTIES_DEFINE() in twoThomas Haller2016-02-191-2/+5
| | | | | Sometimes we don't need the _notify() helper which results in a unused-function warning.
* all: cleanup includes and let "nm-default.h" include "config.h"Thomas Haller2016-02-19437-1000/+801
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - All internal source files (except "examples", which are not internal) should include "config.h" first. As also all internal source files should include "nm-default.h", let "config.h" be included by "nm-default.h" and include "nm-default.h" as first in every source file. We already wanted to include "nm-default.h" before other headers because it might contains some fixes (like "nm-glib.h" compatibility) that is required first. - After including "nm-default.h", we optinally allow for including the corresponding header file for the source file at hand. The idea is to ensure that each header file is self contained. - Don't include "config.h" or "nm-default.h" in any header file (except "nm-sd-adapt.h"). Public headers anyway must not include these headers, and internal headers are never included after "nm-default.h", as of the first previous point. - Include all internal headers with quotes instead of angle brackets. In practice it doesn't matter, because in our public headers we must include other headers with angle brackets. As we use our public headers also to compile our interal source files, effectively the result must be the same. Still do it for consistency. - Except for <config.h> itself. Include it with angle brackets as suggested by https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
* device: don't allways set assumed reason when platform init is doneLubomir Rintel2016-02-191-1/+18
| | | | | | | | | | | | | | | | | When the device is transitioning from unmanaged to disconnected for "assumed" reason, bring_up is not called. This is not a good thing in numerous instances, e.g.: 1.) vlans that we've created need that to set IFF_UP and read carrier otherwise they won't be available for connections. 2.) veths that are being managed need to start the deferred carrier check so that the behavior matches real Ethernet. 3.) Hardware devices that were plugged in while NetworkManager is running that need the IFF_UP for a carrier check, possibly enqueueing a deferred one. Fixes: 5637d72af2d51b6f2b8dbe70553754f1828fdb66.
* shared: fix nm_sprintf_buf() macro to allow plain stringThomas Haller2016-02-191-2/+2
| | | | | Use non-portable gcc extension to allow for zero variadic arguments so that you can pass a plain string as argument.
* device: expose NMIP4Config:addresses in stable/defined sort orderThomas Haller2016-02-183-0/+71
| | | | | | | | Like we already do for IPv6 addresses, we should expose addresses in a defined, stable sort order. Clients usually show the addresses in the same order as obtained via D-Bus.
* platform: expose nmp_utils_ip4_address_is_link_local() functionThomas Haller2016-02-184-12/+18
|
* Revert "build: fix detection of NSS library on Debian"Thomas Haller2016-02-181-5/+1
| | | | | | | | | | | | | Sorry, it was not Debian's fault. It is only libnss-devel package on Ubuntu 12.04/Precise [1]. Revert the workaround and avoid the failure by dropping the version check altogether. NSS 3.11 is from 2006, it's unlikely a user tries to build current NetworkManager against such an old version of the library. [1] https://bugs.launchpad.net/ubuntu/+source/nss/+bug/1547147 This reverts commit d48790cbec7d19b20a10e1627dd8ee1c996425b1.
* device: fix assertion on unmanaged_mask for slave devicesBeniamino Galvani2016-02-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When executing these commands: ip link add br0 type bridge ip link set dev br0 up ip link add dummy1 type dummy ip link set dev dummy1 up ip addr add 1.1.1.1/24 dev br0 brctl addif br0 dummy1 sleep 1 ip link del br0 ip link del dummy1 the following assertion was failing: nm_device_master_release_one_slave: runtime check failed: (NM_FLAGS_HAS (slave_priv->unmanaged_mask, NM_UNMANAGED_IS_SLAVE)) #0 g_logv() #1 g_log() #2 g_warn_message() #3 nm_device_master_release_one_slave() #4 nm_device_cleanup() #5 _set_state_full() #6 nm_device_state_changed() #7 nm_device_unrealize() #8 _platform_link_cb_idle() #9 g_main_context_dispatch() #10 g_main_context_dispatch() #11 g_main_context_iterate() #12 g_main_loop_run() #13 main() Upon slave removal we unrealize the device, resetting the unmanaged flags to NM_UNMANAGED_PLATFORM_INIT, then we clean up the device and call nm_device_master_release_one_slave(), which asserts the presence of NM_UNMANAGED_IS_SLAVE flag cleared just before. Drop the check. Fixes: 87a3df2e572ed47b5f76f6d1cad63ce622296e21
* build: fix detection of NSS library on DebianThomas Haller2016-02-181-1/+5
| | | | | | | Debian added an epoch "2" to the version of NSS library. Fix configure to account for that. Related: https://launchpad.net/debian/sid/+source/nss
* ifcfg-rh/tests: pass arguments to tests via nmtst_add_test_func()Thomas Haller2016-02-181-144/+115
| | | | And call all tests via g_test_run().
* ifcfg-rh: more testcase cleanupsDan Williams2016-02-171-924/+349
|
* cli: disable colors on dumb terminalsLubomir Rintel2016-02-171-2/+7
| | | | | Nothing too sophisticated; just a simple way to get an color-less output on a pty that wouldn't confuse the test suite.
* manager: don't proceed with activation when there's no master deviceLubomir Rintel2016-02-171-15/+0
| | | | | | | | Since the device-for-all merge it's a sin (trips an assert) to create an activation request with NULL device. If we get here, it's probably that the master device exists, but is not ready for activation (it's in UNMANAGED state in the process of being created).
* merge: branch 'th/lr/conn-device-ifname'Lubomir Rintel2016-02-1713-149/+104
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=762154
| * device: optimize nm_manager_get_connection_iface()th/lr/conn-device-ifnameThomas Haller2016-02-171-0/+14
| |
| * device: don't overwrite get_connection_iface() by defaultThomas Haller2016-02-171-20/+7
| | | | | | | | | | | | Factories that overwrite this function are not supposed to chain up the parent implementation. Thus there is no reason to have a default implementation and it's clearer to inline it.
| * manager: reused the factory looked up in nm_manager_get_connection_iface()Thomas Haller2016-02-171-7/+10
| | | | | | | | Only lookup the factory once and pass it down to find_parent_device_for_connection().
| * device: remove interface name checks from all classesLubomir Rintel2016-02-176-44/+3
| | | | | | | | Generic check_connection_compatible() already does the check.
| * device: move the interface name check from managerLubomir Rintel2016-02-172-12/+13
| | | | | | | | | | | | | | | | We not only want to check the device name when creating a virtual device, but also when determining if the connection can actually be activated there. Otherwise the device names will mix up if there's more connections that use virtual devices of the same type.
| * manager: export nm_manager_get_connection_iface()Lubomir Rintel2016-02-172-12/+18
| | | | | | | | | | We'll need the actual device name that should be used for a connection activated on a given device when checking the connection availability.
| * device-factory: always use the factory to determine the connection's ↵Lubomir Rintel2016-02-172-22/+7
| | | | | | | | | | | | | | interface name This makes things a bit simpler when determining if any connection is activatable on an existing device.
| * device-factory/trivial: rename get_virtual_iface_name() to ↵Lubomir Rintel2016-02-178-42/+42
|/ | | | get_connection_iface()
* utils: fix NM_UTILS_ENUM2STR_DEFINE() which always returned the last elementThomas Haller2016-02-171-1/+1
| | | | Fixes: 174b25d98c3ae395f5b41fc2e7d5c222cb6369cf
* platform: add IN6_ADDR_GEN_MODE_RANDOM to ↵Thomas Haller2016-02-172-0/+2
| | | | | | nm_platform_link_inet6_addrgenmode2str() There is a new address generation mode.
* platform: use nm_platform_link_inet6_addrgenmode2str() in link-to-stringThomas Haller2016-02-171-17/+3
| | | | | | | Reuse the to-string function nm_platform_link_inet6_addrgenmode2str() to print the addrgenmode for nm_platform_link_to_string(). Also, now we support NM_IN6_ADDR_GEN_MODE_STABLE_PRIVACY.
* platform: stack-allocate temporary string in ↵Thomas Haller2016-02-171-8/+5
| | | | nm_platform_link_tun_get_properties_ifname()
* contrib/rpm: add README, improve usage output and rename --no-build option ↵Thomas Haller2016-02-172-6/+32
| | | | to --no-dist
* shared: move definition of "bool" to nm-macros-internal.hThomas Haller2016-02-162-47/+47
| | | | | | | | "nm-default.h" should only include all the relevant header files based on NETWORKMANAGER_COMPILATION. It should not contain definitions on it's own. Move the definition of "bool" to "nm-macros-internal.h".
* manager: fix typo in error messageBeniamino Galvani2016-02-161-1/+1
| | | | Fixes: 1762d58a8cf7fbd21b6940fb2a15c136952a9603
* platform: merge branch 'th/platform-recvmsgs-fixes-bgo761959'Thomas Haller2016-02-163-28/+24
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=761959
| * platform: during @abort_parsing goto stop in event_handler_recvmsgs()Thomas Haller2016-02-161-5/+2
| | | | | | | | | | Now, that we no longer overwrite @err, we can jump to stop: instead of out:.
| * platform: don't set @err during stop: in event_handler_recvmsgs()Thomas Haller2016-02-161-1/+1
| | | | | | | | | | | | If we break the loop normally, @err must be already set to zero. The only other way this can happen is when the credentials are invalid. Move setting @err to there.
| * platform: continue reading in event_handler_recvmsgs() when not handling eventsThomas Haller2016-02-161-1/+4
| | | | | | | | | | | | If @handle_events is FALSE, we want to drain the socket. In that case even when encountering an error error we don't want to abort, but instead continue reading the next message.
| * platform: fix error handling in event_handler_recvmsgs()Thomas Haller2016-02-161-2/+3
| | | | | | | | | | | | @abort_parsing is set TRUE at two places, which also explicitly set @err to something. We don't want to reset @err and got to the next @hdr. Instead error out first.
| * platform: downgrade logging message to TRACE level in event_handler_recvmsgs()Thomas Haller2016-02-161-2/+2
| | | | | | | | Doesn't seem important and might be triggered by other processes.
| * platform: don't return number of messages from event_handler_recvmsgs()Thomas Haller2016-02-161-6/+1
| | | | | | | | | | | | The value is not used by the callers. Also, with @handle_events set to false, it is not clear what the value really means because we skip over errors.
| * platform: simplify event_handler_recvmsgs() by using cleanup attributeThomas Haller2016-02-161-15/+5
| |
| * macros: add nm_auto_free macroThomas Haller2016-02-162-1/+11
|/ | | | | Similar to gs_free to cleanup pointers with free(). Note that g_free() and free() cannot be used interchangably.
* travis: update .travis.yml not to run tests when build failsThomas Haller2016-02-161-4/+4
| | | | | When building fails, we should not run the tests. They clutter the output.
* platform/tests: workaround test failure for kernel bugThomas Haller2016-02-161-3/+11
| | | | | | | | Unenslaving from a bridge can cause a spurious RTM_DELLINK signal. NMPlatform does raise those signals, but fixes the state of the cache afterwards. Workaround the test failure. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1285719
* merge: branch 'bg/dhcp-timeout-property-bgo761464'Beniamino Galvani2016-02-1610-55/+55
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=761464
| * libnm-core: fix ifcfg-rh documentation for dhcp-timeout propertyBeniamino Galvani2016-02-161-2/+2
| | | | | | | | Fixes: 3f0d595cc827d9e1117bc5c796aa11185ba8c5d7
| * libnm-core: make ipvx.dhcp-timeout signedBeniamino Galvani2016-02-163-9/+9
| | | | | | | | | | | | | | | | Change the dhcp-timeout property in NMSettingIPConfig to int type for consistency with the dad-timeout property. For dad-timeout -1 means "use default value", while for dhcp-timeout probably we will never use negative values, but it seems more correct to use the same type for the two properties.
| * libnm,core,cli: move dhcp-timeout property to generic NMSettingIPConfigBeniamino Galvani2016-02-1610-52/+52
|/ | | | | The property applies to both IPv4 and IPv6 and so it should not be in NMSettingIP4Config but in the base class.
* device: merge branch 'th/device-applied-connection-bgo760884'Thomas Haller2016-02-1611-28/+475
|\ | | | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=760884 https://bugzilla.gnome.org/show_bug.cgi?id=761714
| * introspection: document the meaning of active connectionsThomas Haller2016-02-161-0/+9
| |
| * device: fix signature for @flags argument of impl_device_reapply()Thomas Haller2016-02-163-6/+6
| | | | | | | | | | Thereby, also adjust the type for libnm's wrapper function -- as we already broke ABI.
| * libnm: add nm_device_get_applied_connection() functionThomas Haller2016-02-163-0/+194
| |