Commit Graph

10071 Commits

Author SHA1 Message Date
Dan Williams
46abe332b8 core: remove nm_device_ignore_carrier()
No longer used anywhere.
2014-03-04 15:21:58 -06:00
Dan Williams
3a7f07e2f0 core: postpone non-static master IP configuration until carrier
This got broken at some point.  The intent of ignore-carrier was always
to ignore the carrier for IP configuration for static/manual connections,
but never for DHCP/SLAAC where a link is actually required.  Thus
when checking whether to postpone IP configuration for a master interface
that's using DHCP/SLAAC, don't allow ignore-carrier to factor into
the decision.
2014-03-04 15:21:58 -06:00
Dan Williams
1d5847c8a6 core: match IPv4 'disabled' method to 'auto' when device has no link
If IPv4 configuration did not succeed or the device has no IPv4 addresses
when NM restarts, it will detect the existing device configuration as
'disabled'.  This can happen when a bridge has no slaves and thus cannot
perform IPv4 addressing because it has no carrier (since bridge carrier
status depends on slave carriers).  When NM starts or restarts, it
sees the bridge has no IPv4 address and assumes the IPv4 method is
'disabled'.  This creates a new connection, which blocks any slave
connections from activating if they specify their master via UUID
 (since the bridge's active connection is generated).

Fix this by allowing matches from 'disabled' to 'auto' if the device
has no carrier, and there are no other differences between the
original and the candidate connections.
2014-03-04 15:21:58 -06:00
Dan Williams
7b65f8934e core: refactor connection matching and add testcase
Refactor in preparation for some additional matching, and add testcases.
2014-03-04 15:21:58 -06:00
Dan Williams
2fe5ebe21c core: correctly handle pre-activation dependency failure (rh #1069695)
Dependencies may fail before the activation actually starts, like
when a software device gets removed while the activation is
scheduled but before it has started.  In these cases, the
activation request should fail.
2014-03-04 15:21:29 -06:00
Dan Williams
b7598bbb8c core: ensure ActiveConnections stay alive over activation paths
With some upcoming changes, ActiveConnection objects could change to
DEACTIVATED state during activation, for example if the AC's device
was removed while the AC was being authorized.

To ensure the AC stays alive and is not used after being freed,
keep a reference to the AC across authorization operations.
2014-03-04 15:21:29 -06:00
Thomas Haller
3e9ba55c3a platform: move asserts for sysctl_get/set functions to nm-linux-platform
Also assert inside of sysctl_get() that we read the expected file
locations. Especially because now we might log the content of these
files.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-04 21:21:35 +01:00
Thomas Haller
087c88f729 platform: add logging when reading and writing sysctl values
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-04 21:06:21 +01:00
Thomas Haller
6655d5c949 platform: remove logging about check_cache_items()
We don't thoroughly log the pointer values of our libnl objects,
so the logging in check_cache_items() is not usefull, it only
clutters the logfile.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-04 18:21:37 +01:00
Jiří Klimeš
b8915dae3c policy: fix crash caused by calling functions on connection==NULL
Crash appeared in:
nm_settings_connection_set_autoconnect_blocked_reason()
2014-03-04 16:53:35 +01:00
Dan Williams
7bfbd5e52a core: #include <gmodule.h> for G_MODULE_EXPORT
When some configure-time options aren't used, <gmodule.h> is not
included.  Fix that.
2014-03-04 09:11:23 -06:00
Jiří Klimeš
9e0f4179fd devices: fix compilation of nm_device_factory_new_link()
We have to return a value.
2014-03-04 11:07:33 +01:00
Dan Williams
c1a064b9a3 merge: move ATM, Bluetooth, and WWAN into device plugins (bgo #724324)
Enhance the device plugin interface and convert ATM, BT, and WWAN to
use it.  This saves 15% of the binary size of the core NM binary, and
packagers or users can decide which plugins they would like to install,
thereby saving disk space and memory.

https://bugzilla.gnome.org/show_bug.cgi?id=724324
2014-03-03 16:07:53 -06:00
Dan Williams
493bbbeb4a core: consolidate auto-activation recheck signals
Add a generic signal that devices can use to indicate that something
material in the network situation changed, and that auto-activation
may now be possible.  This reduces specific knowledge of device types
in the policy.
2014-03-03 09:32:41 -06:00
Dan Williams
aeb1e103d8 mobile: make WWAN support a plugin
Make WWAN support a plugin using the new device factory interface.
Provides a 5% size reduction in the core NM binary.

     Before    After
NM: 1187224  1125208  (-5%)
MM:       0   100576

(all results from stripped files)
2014-03-03 09:32:41 -06:00
Dan Williams
a9591aecaf bluez: make Bluetooth support a plugin
Make Bluetooth support a plugin using the new device factory interface.
Provides a 5% size reduction in the core NM binary.

     Before   After
NM: 1253016 1187224 (-5%)
BT:       0   85752

(all results from stripped files)
2014-03-03 09:32:41 -06:00
Dan Williams
71a52347f3 atm: make ADSL support a plugin
Make ADSL support a plugin using the new device factory interface.
Provides a 1% size reduction in the core NM binary.

      Before    After
NM:  1265336  1253016  (-1%)
ATM:       0    27360

(all results from stripped files)
2014-03-03 09:32:41 -06:00
Dan Williams
2a04df856b devices: rework device plugin interface to be more flexible
In preparation for making WWAN and Bluetooth plugins, rework
the device plugin interface to meet those plugins' needs and
port WiMAX over in the process.
2014-03-03 09:32:41 -06:00
Dan Williams
8e9b9fe423 mobile: convert to device removed signals
Instead of having NMManager listen directly to the ModemManager
for modem removal signals, have the NMDeviceModem and NMDeviceBt
listen for them (since they obviously have a pointer to the backing
NMModem object) and then re-emit any necessary device removal
signals to the manager.
2014-03-03 09:32:40 -06:00
Dan Williams
ee66964208 core: allow devices to indicate when they should be removed
Devices created by plugins will use this to indicate when their
backing resources have disappeared, at which point the manager
should remove them.
2014-03-03 09:32:40 -06:00
Dan Williams
fd3fe2200c core: add nm_connection_provider_get()
In reality the connection provider (NMSettings) is always the same
object, and some device plugins need access to it.  Instead of
cluttering up the device plugin API by passing the provider into
every plugin regardless of whether the plugin needs it, create
a getter function.
2014-03-03 09:32:40 -06:00
Dan Williams
fe6b86a078 core: don't ref the Manager singleton
The OLPC mesh code did rely on nm_manager_get() referencing the
singleton when returning it, but all other callers of nm_manager_get()
did not.  Thus the manager's refcount would always increase and
almost never decrease.  Fix the refcounting so that the manager
always has only one ref, and it's lifetime is controlled by
main() and nothing else.
2014-03-03 09:32:40 -06:00
Jiří Klimeš
550ce1e631 examples: add a GOI Python example for getting active connections 2014-03-03 15:15:08 +01:00
Jiří Klimeš
f24eee5ee3 examples: also print type of active connections 2014-03-03 14:28:51 +01:00
Jiří Klimeš
296d7f6ec7 cli: fix a crash when trying to set a white-space string as IP (rh #1071394)
nmcli con modify my-profile ipv4.addr "   "
nmcli con modify my-profile ipv6.addr "   "

Note:
Empty string should be used to remove IPs, and 'method' might be needed to set
to 'auto' simultaneously, as well.
$ nmcli con modify profile1 ipv4.addr "" ipv4.method auto

https://bugzilla.redhat.com/show_bug.cgi?id=1071394
2014-03-03 12:50:02 +01:00
Jiří Klimeš
d98a34dcda libnm-util: more specific error for missing ipv[46].adddress when method=manual 2014-03-03 12:42:05 +01:00
Thomas Haller
90ff0786cc cli/bash-completion: fix nmcli connection CMD completion for --help option
The --help option (or its aliases -help/help) is only allowed at as
first argument. Fix completion to account for this.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-02 17:55:14 +01:00
Thomas Haller
74b3c22e2f cli/bash-completion: only allow --help as first argument for nmcli connection modify
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-01 02:07:53 +01:00
Thomas Haller
9d7a1d4253 cli/bash-completion: use printf instead of echo (because echo inteprets some --options)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-01 02:07:53 +01:00
Thomas Haller
39dc39ec0a cli/bash-completion: simplify code by passing arrays by indirection to functions
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-01 02:07:53 +01:00
Dan Winship
74809e64cc libnm-glib: fix glib-mkenums warnings
glib-mkenums doesn't parse /*< public >*/ and /*< private >*/, and in
fact, it warns about them, so don't write it that way.
2014-02-28 16:13:22 -05:00
Dan Winship
e4a8cfd502 libnm-util: fix some parameter names to kill gtk-doc warnings 2014-02-28 16:12:49 -05:00
Jiří Klimeš
e3176dfa0d man: add a note about hostname to nmcli manual page 2014-02-28 14:44:22 +01:00
Thomas Haller
16bbc90c16 release: bump version to 0.9.9.1 (development)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:21:35 +01:00
Thomas Haller
bdc60d433d cli/man: indicate that nmcli connection delete accepts more then one connections
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:17:32 +01:00
Thomas Haller
62cf1d85ff cli/bash-completion: complete more then one connections for nmcli connection delete
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:14:32 +01:00
Thomas Haller
4196cc1179 cli/bash-completion: complete more then one properties for nmcli connection modify
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:14:32 +01:00
Thomas Haller
280881f552 cli/bash-completion: complet nmcli connection modify --temporary
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:14:32 +01:00
Thomas Haller
07cdf56a67 cli/bash-completion: support abbreviated options for commands
Add support for abbreviated options as first argument:

nmcli connection show --act <TAB>

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:14:32 +01:00
Thomas Haller
7423bc4460 cli/bash-completion: support abbreviations for options
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:14:32 +01:00
Jiří Klimeš
223962f4ad man: add a simple bridge example to nmcli-examples manual page 2014-02-28 13:37:02 +01:00
Jiří Klimeš
1472d76744 Merge changes for 'nmcli con modify' (rh #1044027)
It allows set vs. append property value by 'nmcli con modify' and also
inside interactive editor.

And also allow doing temporary changes with 'nmcli con modify'.

https://bugzilla.gnome.org/show_bug.cgi?id=724036
https://bugzilla.redhat.com/show_bug.cgi?id=1044027
2014-02-28 12:11:24 +01:00
Jiří Klimeš
ebb601302a cli: update 'nmcli con modify' help 2014-02-28 11:44:34 +01:00
Jiří Klimeš
2ef197983f man: update nmcli manual page to stress that we can remove values by name 2014-02-28 11:19:13 +01:00
Jiří Klimeš
a5673d113c cli: update 'remove' command description for 'nmcli con edit'
to reflect that user can specify a value or index to remove values.
2014-02-28 11:17:49 +01:00
Jiří Klimeš
f29ad0bd52 cli: allow removing properties by-value (in addition to by-index)
It works both in 'nmcli con modify' and 'nmcli con edit'.

The following properties are supported (all container-type properties except
properties with option names):
ipv4.dns
ipv4.dns-searches
ipv4.addresses
ipv4.routes

ipv6.dns
ipv6.dns-searches
ipv6.addresses
ipv6.routes

802-1x.eap
802-1x.altsubject-matches
802-1x.phase2-altsubject-matches

connection.permissions
connection.secondary

802-3-ethernet.mac-address-blacklist

802-11-wireless.mac-address-blacklist

802-11-wireless-security.proto
802-11-wireless-security.pairwise
802-11-wireless-security.group

vlan.ingress-priority-map
vlan.egress-priority-map
2014-02-28 11:17:17 +01:00
Jiří Klimeš
642cfdeebf libnm-util: add *_remove_*_by_value() functions for 'vlan' setting
nm_setting_vlan_remove_priority_by_value()
nm_setting_vlan_remove_priority_str_by_value()
2014-02-28 10:39:09 +01:00
Jiří Klimeš
1e5370b4d2 libnm-util: add *_remove_*_by_value() functions for '802-11-wireless-security' setting
nm_setting_wireless_security_remove_proto_by_value()
nm_setting_wireless_security_remove_pairwise_by_value()
nm_setting_wireless_security_remove_group_by_value()
2014-02-28 10:39:09 +01:00
Jiří Klimeš
de646d9588 libnm-util: add *_remove_*_by_value() functions for '802-11-wireless' setting
nm_setting_wired_remove_mac_blacklist_item_by_value()

Also add missing function nm_setting_wired_clear_mac_blacklist_items() and notify
about mac-address-blacklist changes.
2014-02-28 10:39:09 +01:00
Jiří Klimeš
ca0aa8139c libnm-util: add *_remove_*_by_value() functions for '802-3-ethernet' setting
nm_setting_wired_remove_mac_blacklist_item_by_value()
and missing
nm_setting_wired_clear_mac_blacklist_items()
2014-02-28 10:39:09 +01:00