Commit Graph

15047 Commits

Author SHA1 Message Date
Jiří Klimeš
62d113f6c2 cli: accept 'primary' bonding option 2013-10-02 11:48:07 +02:00
Jiří Klimeš
1bb78f6ecf cli: enhance questionnaire for bond connections (rh #1007355)
The session now looks like this:

There are optional arguments for 'bond' connection type.
Do you want to provide them? (yes/no) [yes]
Bonding mode [balance-rr]:
Bonding monitoring mode (miimon or arp) [miimon]: miimon
Bonding miimon [100]:
Bonding downdelay [0]:
Bonding updelay [0]:

...when answered arp...
Bonding arp-interval [0]:
Bonding arp-ip-target [none]:

https://bugzilla.redhat.com/show_bug.cgi?id=1007355
2013-10-02 11:48:07 +02:00
Jiří Klimeš
9e9afdb25b cli: fix memory leaks on questionnaires 2013-10-02 11:48:07 +02:00
Dan Williams
d3aae79e5c dhcp: fix IPv6 address prefixes (rh #1013583)
53e55aab36 mistakenly moved the address
prefix without moving the memset() to initialize the address.  Make
sure the address is initialized before trying to do anything with it.
2013-10-01 15:48:25 -05:00
Dan Williams
1b773f4e6e libnm-glib: make properties-changed debugging available at runtime
Use an environment variable LIBNM_GLIB_DEBUG=properties-changed to
indicate that properties-changed debugging messages should be printed.
Also cleans up the debug output formatting.
2013-10-01 11:17:59 -05:00
Jiří Klimeš
6d2e033a0e libnm-util: only remove ARP when MIIMON is being set to non-zero and vice versa
miimon or arp_interval == 0 means 'disable'. So we should not remove options of
one mode when the other mode is actually being disabled (set to zero).
2013-10-01 17:26:03 +02:00
Thomas Haller
0f88cb13f1 team: remove variable teamd_on_dbus that was always FALSE
The variable teamd_on_dbus in nm-device-team was never set to TRUE.
Remove it. Also, before teamd_dbus_vanished did never cleanup anything.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-10-01 11:45:46 +02:00
Thomas Haller
d11f41a8a0 team: fix wrong assertion in device-team
The assertion that priv->teamd_pid is set does not hold.

For example, if no teamd binary can be found, "Stage 1 of 5 (Device
Prepare)" fails with "Activation (nm-team) to start teamd: not found".
This causes the device state to become "failed" and later
"disconnected", which in turn calls teamd_stop without a valid teamd_pid
set.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-10-01 11:18:13 +02:00
Jiří Klimeš
f767e05f4a team: chain up parent dispose() in NMDeviceTeam dispose() (rh #1013593)
NMDeviceTeam dispose() did not chain up to parent dispose(). This prevented
parent dispose() to be called (only finalize()) and thus link_changed_cb()
and device_ip_changed() handlers were not disconnected. Later these handlers
were called on invalid device resulting in a crash.

https://bugzilla.redhat.com/show_bug.cgi?id=1013593
2013-10-01 10:23:12 +02:00
Thomas Haller
ed08a3fe04 cli: fix missing type option 'team' in mcli completion
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-30 19:07:18 +02:00
Jiří Klimeš
a74d3678d1 cli: use a generic function asking for both IPv4/IPv6 in questionnaire 2013-09-30 13:42:13 +02:00
Jiří Klimeš
5ba3e42b1e cli: be more verbose when adding IP addresses in questionnaire (rh #1006450)
Now the session looks like this:
Do you want to add IP addresses? (yes/no) [yes]
Press <Enter> to finish adding addresses.
IPv4 address (IP[/plen] [gateway]) [none]: 10.0.0.22/24 10.0.0.1
  Address successfully added: 10.0.0.22/24 10.0.0.1
IPv4 address (IP[/plen] [gateway]) [none]: 10.0.0.22/24 10.0.0.1
  Warning: address already present: 10.0.0.22/24 10.0.0.1
IPv4 address (IP[/plen] [gateway]) [none]: 192.168.1.1 abc
Error: invalid gateway 'abc'
IPv4 address (IP[/plen] [gateway]) [none]:
IPv6 address (IP[/plen] [gateway]) [none]: abcd::1234 ::2 blabla
  Address successfully added: abcd::1234 ::2
  Warning: ignoring garbage at the end: 'blabla'
IPv6 address (IP[/plen] [gateway]) [none]:
2013-09-30 13:39:44 +02:00
Jiří Klimeš
469febc0d9 rdisc: do not crash on NDP init failures (rh #1012151)
ndp_open() can fail, do not assume it cannot.
When 'ipv6.disable=1' kernel parameter is used, the whole IPv6 stack is
disabled and the attempt to create PF_INET6 socket fails.

https://bugzilla.redhat.com/show_bug.cgi?id=1012151
2013-09-30 12:08:35 +02:00
Dan Winship
e69727bf8a libnm-util: support the "primary" bond option 2013-09-27 09:34:41 -04:00
Jiří Klimeš
6b9b3adbd1 trivial: remove trailing spaces 2013-09-27 13:26:29 +02:00
Jiří Klimeš
282b9df60d vpn: fix VPN plugin D-Bus errors
The errors were documented as org.freedesktop.NetworkManager.VPN.Error.*,
but the actual values were org.freedesktop.NetworkManager.VPN.Plugin.*

Also update the errors documentation.
2013-09-27 13:26:29 +02:00
Jiří Klimeš
9dff830692 vpn: fix connecting to VPN (bgo #708255)
The ConnectInteractive() -> Connect() fallback code doesn't work, because
_connect_internal() changes the state to NM_VPN_SERVICE_STATE_STARTING before
checking if it can implement ConnectInteractive(), and then when the Connect()
call comes in, the VPN is not in STOPPED or INIT, so it returns an error.

The commit moves setting state to STARTING after the ConnectInteractive() check
availability, in the plugin. We introduce new plugin error and set it when the
the plugin does not implement ConnectInteractive(). NetworkManager uses this
error for ConnectInteractive() -> Connect() fallback.

https://bugzilla.gnome.org/show_bug.cgi?id=708255
2013-09-27 13:26:09 +02:00
Enrico Nicoletto
f9bb4bb2ca po: updated Brazilian Portuguese (pt_BR) translation (bgo #708869)
https://bugzilla.gnome.org/show_bug.cgi?id=708869

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-27 11:57:53 +02:00
Dan Winship
e98eb83a1a libnm-glib: fix cut+pasteo 2013-09-26 17:19:18 -04:00
Dan Williams
57c99c11fe core: don't run Bluetooth disconnect unless the device was connected
Don't unconditionally call disconnect during device deactivation, since
the device also gets deactivated in the UNAVAILABLE -> DISCONNECTED
state change, long before any Bluetooth connection has been made.
2013-09-26 15:50:00 -05:00
Dan Williams
a045c29638 api: clarify lifetime and behavior of ActiveConnection's SpecificObject property (rh #1012309)
It doesn't change once it's set, and it reflects the original
specific object used during activation.  It will not, for example,
switch to the currently active WiFi access point even if the
original access point that was used as the specific object disappears.
2013-09-26 12:17:51 -05:00
Jiří Klimeš
f820fbeeb3 examples: add an python example (using GI) showing Wi-Fi networks 2013-09-26 16:30:23 +02:00
Thomas Haller
1f4608e06e bluez: fix compile error in nm-bluez-device for BlueZ 4 (unused variable)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-26 13:41:12 +02:00
Dan Williams
1735fadc10 trivial: print a more informative warning if built for Bluez5 but Bluez4 is installed 2013-09-25 19:45:15 -05:00
Thomas Haller
4fe20ed4d8 core: add const qualifier to functions in nm-ip[46]-config
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 23:12:37 +02:00
Thomas Haller
db9b7e10ac core: update existing IP[46]Config of device instead of replacing it (bgo #707617)
When the IP[46]Config changes, a new configuration gets assembled.
Before, whenever the new configuration was different than the current
one, the IP[46]Config of the device was completely replaced. This also
meant, that the old dbus IP[46]Config object was removed and the new one
was exported.

Now instead of recreating a new configuration, it updates the existing
(already exported) configuration in-place.

Also, add new gobject properties 'gateway' and 'searches' to the config class,
they will be exported over dbus.

Also, whenever any of the exported properties changes, make sure that a
notify signal gets emitted.

https://bugzilla.gnome.org/show_bug.cgi?id=707617

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 23:12:37 +02:00
Thomas Haller
f0fccd99a5 core: add nm_ip[46]_config_replace functions
This new function copies the entire configuration of an existing
NMIP[46]Config object (src) and replaces the configuration in the destination
object (dst) in-place.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 23:12:37 +02:00
Thomas Haller
b1113a0a59 core: add nm_platform_ip[46]_*_cmp functions
New functions to compare two instances of NMPlatformIP4Address, NMPlatformIP6Address,
NMPlatformIP4Route, NMPlatformIP6Route, respectively.

These functions return -1, 0 or 1 as result of the comparison. This is similar to
strcmp with the additional restriction, that only one of these 3 values will be
returned.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 23:12:37 +02:00
Thomas Haller
a7c7b9f5aa trivial: fixup whitespace
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 23:12:37 +02:00
Thomas Haller
a84fc3169a bluez: merge adding support for BlueZ 5 (bgo #701078)
Merge adding support for BlueZ 5. Both BlueZ 4 and 5 still work, but you
have to decide at compile time which version to use. By default BlueZ 5
will be build, use ./configure --enable-bluez4=yes to enable BlueZ 4.

BlueZ 5 currently only works with PAN devices, DUN devices are not yet
supported.

https://bugzilla.gnome.org/show_bug.cgi?id=701078

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 22:59:50 +02:00
Thomas Haller
e0e10a06b2 bluez: remove the device from manager before emitting REMOVED signal
As we iterate through the list of devices that are about to removed,
they should be removed before emitting the signal.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 22:58:04 +02:00
Dan Williams
ef472259cf bluez: fix emitting of REMOVED signal in manager
Ensure, before emitting the REMOVED signal for devices, that the device
was usable before.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 22:57:45 +02:00
Thomas Haller
07cc990981 bluez: ensure that address of NMBluezDevice cannot be reset
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:14:41 +02:00
Dan Williams
050cf2dbae bluez: check bluez5 adapter powered state and remove devices if killed 2013-09-25 21:01:04 +02:00
Dan Williams
961e23a2e2 build: show bluez4 as "no" when not explicitly enabled 2013-09-25 21:01:04 +02:00
Dan Williams
18624eb6dd bluez: combine bluez4 and bluez5 connect/disconnect code
Pretty trivial to combine right now, and use GDBus for everything
here.  No need to stick with dbus-glib for these operations.
2013-09-25 21:01:04 +02:00
Thomas Haller
7ff6b9d29b bluez: rename files from nm-bluez5-* to nm-bluez-*
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
03aeaf7b77 bluez: rename files from nm-bluez-* to nm-bluez4-*
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
b246788bc4 config: make BlueZ 5 default and replace --enable-bluez5 with --enable-bluez4
Build now BlueZ 5 by default and rename the configure flag
--enable-bluez5 to --enable-bluez4.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
cfd4d5209c bluez: do not allow resetting the capabilities of a bluez device
Also freeze gobject notifications while updating proberties.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
57e19288b7 bluez: create NMConnection for PAN devices
Create a new NMConnection for PAN devices if no compatible connection
exists and export it via DBUS. This has the effect of always exposing
any usable PAN-capable device.

https://bugzilla.gnome.org/show_bug.cgi?id=701078

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
98daf270ba core: add add_connection method to NMConnectionProvider
This exposes the functionality of nm_settings_add_connection to the users
of NMConnectionProvider.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
3b12d9ae6e core: add has_connections_loaded method to NMConnectionProvider
This method returns true, if the connections are already loaded (and the
connection_loaded signal already emited).

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
008453e61f bluez: connections must be pre-configured for BlueZ 5 devices
Modify BlueZ 5 device to have the same behaviour as BlueZ 4, i.e. a
pre-configured connection must exist for the device to show up in
NetworkManager's device list.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
dc85b22e0a bluez: take reference for device before creating dbus adapter
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
bda25894ea trivial: rename function nm_bluez_device_call_disconnect to nm_bluez_device_disconnect
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
0cec10c013 bluez: merge file nm-bluez5-device.c into nm-bluez-device.c
The files nm-bluez-device.c and nm-bluez5-device.c are similar.
Merge them together into one file and handle the differences
using #if directives.

This commit does not actually change any functionality. All it does, is
merging the files together and separating the differences with #if#else.

The next commit will further add common functionality, so this
reduces code duplication for now.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
daef45bdc0 bluez: no need to check for valid GError if glib function fails
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Thomas Haller
c3e644fbb4 trivial: change nm-bluez*-device.c to be more similar
These two files share much code, so they will be merged
into one file.

As a first step, make some trvial renaming to make the two
files more similar and easier to merge.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00
Emilio Pozuelo Monfort
1ae5d53354 bluez: add support for BlueZ 5
At this moment we only support one of BlueZ 4 and 5,
which has to be defined at build time.

Patch rewritten by Thomas Haller <thaller@redhat.com>

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 21:01:04 +02:00