summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* WIP: device: delay dhcp6_start for LLth/wip/bgo726280_dhcp6_wait_llth/bgo726280_dhcp6_wait_llDan Williams2015-07-071-45/+51
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* WIP: dhcp: refactor dhcp manager to support queueing of clients and async ↵Thomas Haller2015-07-073-58/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | killing Up to now, dhcp clients will be killed synchronously. This is especially problematic, because in some cases dhclient does not terminate on SIGTERM, so we block the main loop until timeout. This change makes it possible to kill the client asynchronously. Now, when the manager recieves a signal that the client was removed/timed out, it will no longer remove the client immediatly from its list. Instead it will keep it using a weak ref. Only when the clients references all get freed, the manager will remove it from its list. At the same time, when starting a new client, the manager looks if there is already a client for the same iface/ipv6 running. If so, it will not immediatly start the new client. Instead it will queue it. Killing the client now asynchronously can be done by taking an additional ref of the client instance, send the remove signal and wait for the process to terminate asynchronously. When the process finally terminates, free the ref which in turn will notify the dhcp-manager that the client is now really disposed. In that case it might start any queued client. Signed-off-by: Thomas Haller <thaller@redhat.com>
* dhcp: refactor state to string conversionThomas Haller2014-04-111-46/+37
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* dhcp: refactor using named defines for signal names instead of plain stringThomas Haller2014-04-114-19/+23
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* dhcp: refactor not to pass on NMSettingIP4Config objectsThomas Haller2014-04-118-51/+31
| | | | | | | | | | These settings are mostly unused. Do not pass them when starting the client, instead only pass the argument that is actually used (dhcp_client_id). This simplifies the code later, when we delay starting of DHCP6 clients -- because there is no need to clone the setting. Signed-off-by: Thomas Haller <thaller@redhat.com>
* dhcp: refactor dhcp code to use @dhcp_anycast_addr as #GByteArray typeThomas Haller2014-04-1110-34/+31
| | | | | | | | | | At a later point, we will have to make a copy of @dhcp_anycast_addr to start the client asynchronously. Although the length of the guint8 array *should* always be 6 byte (being a MAC address), it's nicer to just pass on the GByteArray instance instead, which knows how many byte are actually set. Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: merge branch 'th/bgo726525_sort_ip6_addresses'Thomas Haller2014-04-116-71/+493
|\ | | | | | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=726525 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: sort IPv6 addresses (add nm_ip6_config_addresses_sort())Thomas Haller2014-04-114-7/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clients such as gnome-control-center or nm-applet show at some places only one (IPv6) address. They most likely just pick the first address from the list of addresses, so we should order them. Sorting has the advantage to make the order deterministic -- contrary to before where the order depended on run time conditions. Note, that it might be desirable to show the address that the kernel will use as source address for new connections. However, this depends on routing and cannot be easily determined in general. Still, the ordering tries to account for this and sorts the addresses accordingly. https://bugzilla.gnome.org/show_bug.cgi?id=726525 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * test: make use of new libnm-util/nm-test-utils.h headerThomas Haller2014-04-111-63/+21
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * libnm-util: add private header file nm-test-utils.hThomas Haller2014-04-112-1/+263
|/ | | | | | | This is intended to contain utility functions for tests. It will be header only (containing inline functions). Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: sort connections in descending timestamp order on take-over (rh #1067712)Jiří Klimeš2014-04-112-2/+6
| | | | | | | | | When assuming the connections on restart we want to prefer more-recently-used connections. That's why we have to sort connections according to timestamps in descending order. That means connections used more recently (higher timestamp) go before connections with lower timestamp. https://bugzilla.redhat.com/show_bug.cgi?id=1067712
* libnm-glib: add documentation for NMRemoteSettings and connection additionDan Williams2014-04-101-1/+95
|
* Merge branch 'th/bgo726287_cleanup_read_sysctl'Thomas Haller2014-04-109-92/+258
|\ | | | | | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=726287 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * platform: relax assert when checking pathnames for accessing sysctlThomas Haller2014-04-101-2/+2
| | | | | | | | | | | | | | Asserting against "/.." is wrong, because one could rename a link to "..em1", which is a valid ifname but would crash NetworkManager. Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: refactor nm_utils_ascii_str_to_int64()Thomas Haller2014-04-102-41/+151
| | | | | | | | | | | | | | | | | | No need to allocate a dynamic buffer in most of the cases. And extended test cases to test with/without white space and leading zeros. Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: use nm_platform_sysctl_get() to read wifi rfkill valueThomas Haller2014-04-101-2/+4
| | | | | | | | | | | | | | nm_platform_sysctl_get() adds logging and is our prefered way to read sysfs. Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: use nm_platform_sysctl_get() to read infiniband modeThomas Haller2014-04-101-4/+5
| | | | | | | | | | | | | | nm_platform_sysctl_get() adds logging and is our prefered way to read sysfs. Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: use nm_platform_sysctl_get() to read sysctl in NMDeviceAdslThomas Haller2014-04-101-29/+13
| | | | | | | | | | | | | | nm_platform_sysctl_get() adds logging and is our prefered way to read sysfs. Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: use ASSERT_VALID_PATH_COMPONENTThomas Haller2014-04-105-7/+20
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: add ASSERT_VALID_PATH_COMPONENT functionThomas Haller2014-04-102-0/+33
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * platform: add nm_platform_sysctl_get_int_checked() functionThomas Haller2014-04-102-1/+23
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core/trivial: clearify code comment on error for nm_utils_ascii_str_to_int64()Thomas Haller2014-04-102-6/+7
|/ | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* ifcfg-rh: more fix buildDan Winship2014-04-091-1/+1
|
* core: unregister removed devices from D-BusDan Williams2014-04-091-0/+2
| | | | | | | | | | Instead of waiting until the device is disposed and dbus-glib does it for us, remove them when the Manager is done with them. If something (like pending D-Bus calls) holds a reference to the device when the Manager removes it, the device would previously still service method calls until all references are released. When the device is removed, it's dead, and it shouldn't be exported anymore.
* ifcfg-rh: fix buildDan Winship2014-04-093-5/+7
| | | | | | Rebasing the shvar changes to master added some new instances of svNewFile() and svWriteFile() (in the aliases code) that needed to be updated for the API changes.
* fixes/improvements to ifcfg-rh shvar codeDan Winship2014-04-097-360/+343
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=726653
| * ifcfg-rh: return proper error messages from svOpenFile() and svWriteFile()Dan Winship2014-04-097-74/+96
| |
| * ifcfg-rh: (trivial) rename svNewFile() to svOpenFile()Dan Winship2014-04-097-25/+25
| | | | | | | | | | It's "new" in the sense that it creates a new shvarFile object, but it doesn't create a new file, it just opens an existing one.
| * ifcfg-rh: semantic code style fixes to shvar.[ch]Dan Winship2014-04-093-52/+51
| |
| * ifcfg-rh: (trivial) syntactic code style fixes to shvar.[ch]Dan Winship2014-04-092-242/+245
| |
| * ifcfg-rh: fix up lowlevel ifcfg file reading codeDan Winship2014-04-092-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | shvar.c was assuming it could do a single read() to read in the ifcfg file, without taking partial reads or EINTR into account. Fix that. Also, it was keeping the raw contents of the ifcfg file in the shvarFile even though it never looked at it after svOpenFile(). (Presumably lineList originally consisted of pointers into arena, but that had to be changed to support readwrite.) Fix that. It would simplify things further to use g_file_get_contents() and g_file_set_contents(), but the current code is perhaps more resilient to symlink attacks because it keeps the fd open?
| * ifcfg-rh: use g_ascii_strcasecmp() in svTrueValue()Dan Winship2014-04-091-8/+8
| | | | | | | | strcasecmp() is locale-dependent, which is not what we want
| * ifcfg-rh: remove ifcfg inheritance codeDan Winship2014-04-092-63/+14
|/ | | | Nothing was using it, so simplify things by getting rid of it.
* core: fix freeing pending activations in dispose() of deviceThomas Haller2014-04-091-2/+2
| | | | | | | | | | | | | | activate_data_free() deletes the data from priv->pending_activation_checks, thus iterating over the list with g_slist_free_full() causes a double free or invalid memory access. This bug does not hit easily, because the policy only get's disposed when NM shuts down and then there are likely no pending activations queued. Fixes regression introduced by commit 4f0c70e94534abafde6a0459af74b68a7da724d9. Signed-off-by: Thomas Haller <thaller@redhat.com>
* po: fix spelling of "successfully" in msgid stringsMatt Soucy2014-04-083-3/+2
| | | | | | | Typo in messages was already fixed in commit 61de24ba35b452c82ec6f672f62e78feae524e7c. Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: fix hanging pending_action "queued state lock"Thomas Haller2014-04-071-13/+9
| | | | | | | | | | | | | | This bug caused nm-online to hang because "startup complete" state is never reached. Sometimes you also see this error in the logfile: <warn> (em1): add_pending_action (3): 'queued state lock' already added file devices/nm-device.c: line 7178 (nm_device_add_pending_action): should not be reached https://bugzilla.redhat.com/show_bug.cgi?id=1084554 https://bugzilla.redhat.com/show_bug.cgi?id=1084556 Related: https://bugzilla.redhat.com/show_bug.cgi?id=1082045 Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: add some missing -DNM_VERSION_MAX_ALLOWEDDan Winship2014-04-0713-1/+16
| | | | | Add -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE to a bunch of Makefile.ams that were missing it and might eventually need it.
* merge: rework unmanaged options into flags (rh #1030947)Dan Williams2014-04-074-74/+142
|\ | | | | | | | | | | Instead of having separate booleans for each unmanaged option, make them a single flags variable instead. Also split out user-unmanaged from internal management like suspend/resume so we can control them separately.
| * core: split user managed preference (unmanaged specs) out from internal ↵Dan Williams2014-04-072-11/+9
| | | | | | | | | | | | | | | | management We'll want to track internal management separately in the future, so split out user management (eg, whether the device has been explicitly marked unmanaged by the user).
| * core: convert unmanaged bits to flagsDan Williams2014-04-074-72/+139
| | | | | | | | | | | | | | Instead of tracking unmanaged-ness in a couple variables (and because I'd like to add one for user-unmanaged later) let's do it in a single flags variable, and consolidate setting of the unmanaged states in one place.
| * core: don't generate a connection for unmanaged devicesMikhail Efremov2014-04-071-3/+6
|/
* examples: fix qt demo to work without STL supportThomas Haller2014-04-041-2/+2
| | | | | | | | | | | | | | | | The function toStdString() is only available when QT was compiled with STL support. The configure script does not check STL support and might build the QT examples even if toStdString() is not available. Fix this, by not using the function. This fixes the previous commit f73e3669b3bb9b3547173896dcea8e2eb17d30ec that I pushed accidentally. https://bugzilla.gnome.org/show_bug.cgi?id=727608 Signed-off-by: Thomas Haller <thaller@redhat.com>
* platform: workaround older kernels that don't accept extended address flags ↵Thomas Haller2014-04-041-1/+12
| | | | | | | | | | | | | | | | | | | | | via netlink Extended address flags are represented by the additional netlink attribute IFA_FLAGS. Older kernels don't know this flag and refuse the messages RTM_NEWADDR and RTMDEL_ADDR when it contains unknown attributes. See net/core/rtnetlink.c, rtnetlink_rcv_msg(). This was fixed by kernel commit 661d2967b3f1b34eeaa7e212e7b9bbe8ee072b59. libnl was fixed in commit 5206c050504f8676a24854519b9c351470fb7cc6 only to send the additional netlink attribute, when there are actually flags that make this necessary. This commit changes nm-platform to strip the flags to &= 0xFF, if we detect that the kernel does not understand extended address flags. https://bugzilla.redhat.com/show_bug.cgi?id=1063885 Signed-off-by: Thomas Haller <thaller@redhat.com>
* examples: fix qt demo to work without STL supportThomas Haller2014-04-041-2/+2
| | | | | | | | | | | | | The function toStdString() is only available when QT was compiled with STL support. The configure script does not check STL support and might build the QT examples even if toStdString() is not available. Fix this, by not using the function. https://bugzilla.gnome.org/show_bug.cgi?id=727608 Signed-off-by: Thomas Haller <thaller@redhat.com>
* fix typos in documentation and messagesYuri Chornoivan2014-04-033-5/+5
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=727031 Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: add macro STRLENThomas Haller2014-04-031-0/+3
| | | | | | | | Returns the length of a string at compile time. Contrary to strlen(), which is a run time expression -- even if the compler might be able to optimize strlen() for string constants. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix setting DCB application priority (rh #1080510)Dan Williams2014-04-021-4/+4
| | | | | Priority was originally a 'guint' but then got changed to 'gint' and apparently we forgot to fix one place up.
* merge: DCB-related workarounds for lldpad and driver bugs (rh #799241) (rh ↵Dan Williams2014-04-024-40/+330
|\ | | | | | | | | | | | | | | | | | | #1081991) lldpad 0.9.46 and earlier appear to be very sensitive to carrier, and if the interface has no carrier will refuse to do anything with it, reporting that "Device not found, link down or DCB not enabled". So while setting up and tearing down DCB configuration, we must wait for the carrier at various points before proceeding, to ensure that the operations are successful.
| * dcb: wait for carrier down/up after disabling FCoEDan Williams2014-04-021-0/+32
| |
| * dcb: separate DCB enable/disable and wait for carrier changes (rh #799241) ↵Dan Williams2014-04-024-42/+300
|/ | | | | | | | | | | | | | | | | | | | | (rh #1081991) Non-git-master versions of lldpad refuse to touch a device that doesn't have a carrier. And when enabling/disabling DCB, the kernel driver will reconfigure itself and may turn carrier off for a few seconds. So we must ensure that before enabling/disabling DCB, the carrier is already on. Next we must ensure that *after* enabling/disabling DCB, the carrier is back on before doing further DCB setup. There's a race condition between enabling/disabling DCB and receiving the carrier event in NetworkManager that has to be handled carefully. Because the carrier may not yet be down after the dcbtool call to enable/disable DCB returns, we need to wait for a couple seconds for the carrier to go down, and then again for it to come back up. Otherwise we might see the still-on carrier, proceed with DCB setup, and the carrier finally goes down halfway through the setup, which will fail the operations with "DCB not enabled, link down, or DCB not supported" errors from lldpad.