Commit Graph

7740 Commits

Author SHA1 Message Date
Dan Williams
873550592c libnm-util: add Since tags to new functions and properties 2013-02-22 08:34:06 -06:00
Dan Williams
39e48f730d modem: preserve data_iface over PPP connections
data_iface is the serial port over which PPP should be run, so
we need to preserve that and not overwrite it with the PPP interface
name.  When reconnecting, pppd wants the TTY to run PPP over (eg the
ModemManager data_port like ttyUSB0) but if we overwrote that with
ppp0 on the last connection, that's extremely unhelpful and pppd will
fail to start.
2013-02-20 14:01:39 -06:00
Dan Williams
e8df700cdd bluetooth: fix handling of ModemManager restarts
When built with MM1 support, the restart handling code here would
fail for both old MM and new MM.  The code should ignore the
name owner change even if the incoming bus name is *neither*
old MM nor new MM.  It wasn't doing that.
2013-02-20 14:01:34 -06:00
Dan Williams
ddbb13bcc6 core: fix setting IPv6 default route
Seems that NLM_F_CREATE isn't enough, we need to replace anything
that's already there.  Oddly, this is even though we already cleaned
out anything that was already there.
2013-02-20 14:01:30 -06:00
Mihai Dontu
f96a42b0e2 core: allow '2' when reading startup accept_ra value (bgo #691213)
Otherwise, priv->accept_ra_path would be NULL, which isn't very
useful and  makes nm_utils_do_sysctl() angry.  No reason we shouldn't
always create priv->accept_ra_path in the future though.

https://bugzilla.gnome.org/show_bug.cgi?id=691213
2013-02-20 14:01:24 -06:00
Michael Biebl
1556a19c3e Add bash-completion file for nmcli
Based on work by Guillaume Rousse <guillomovitch@gmail.com>
2013-02-19 21:20:59 +01:00
Pavel Šimerda
f0277c19aa settings: add support for code coverage to the settings plugins
Use:

  ./autogen.sh --enable-code-coverage
  make
  make -C src/settings check-code-coverage
2013-02-19 13:05:52 +01:00
Dan Williams
4b863a4b72 trivial: fix up test-general.c after carrier-detect changes 2013-02-18 15:51:33 -06:00
Jiří Klimeš
2fef987980 libnm-util: add the detailed description of carrier-detect to blurb as well
So that we have the description in generated html documentation and nm-settings
manual page.
2013-02-18 15:57:12 +01:00
Jiří Klimeš
1dca1e3c3d cli: print NMDevice's 'available-connections' property in CONNECTIONS section
of 'nmcli device list'

Example:
nmcli -f connections d l iface wlan5
2013-02-18 13:31:00 +01:00
Jiří Klimeš
18609641a0 cli: add CARRIER-DETECT properties for wired, infiniband, vlan settings 2013-02-18 10:09:33 +01:00
Jiří Klimeš
bc867ff6fe core: fix uninitialized priv in set_carrier() 2013-02-18 10:02:52 +01:00
Tomas Pospisek
7b9a581d9c man: reference nm-applet and nm-connection-editor in various manpages (bgo #578906) 2013-02-15 16:21:51 -06:00
Dan Winship
feeafb8cf1 core: Update device activation for :carrier-detect
Add a "need_carrier" argument to nm_device_is_available(), to allow
distinguishing between "device is not available", "device is fully
available", and "device is available except for not having carrier".

Adjust various parts of NMDevice and NMManager to allow for the
possibility of activating a connection with :carrier-detect = "no" on
a device with no carrier, and to avoid auto-disconnecting devices with
:carrier-detect = "on-activate".

https://bugzilla.gnome.org/show_bug.cgi?id=688284
2013-02-15 13:40:39 -05:00
Dan Winship
5266e25e2b libnm-utils: add :carrier-detect properties
For settings corresponding to devices that have a :carrier property
(ie bond, bridge, infiniband, vlan, and wired), add a :carrier-detect
property specifying how that affects the connection:

  yes: The connection can only be activated when the device
      has carrier, and will be deactivated if the device loses
      carrier (for more than 4 seconds).
  no: The connection ignores carrier on the device; it can be
      activated when there is no carrier, and stays activated
      when carrier is lost.
  on-activate: The connection can only be activated when the
      device has carrier, but it will not be deactivated if the
      device loses carrier.

https://bugzilla.gnome.org/show_bug.cgi?id=688284
2013-02-15 13:40:38 -05:00
Dan Winship
fe307dbd3e core: move carrier-detect NMDeviceState handling into NMDevice
Move some duplicated carrier-handling code into NMDevice (which can
introspect itself to see if it's a subclass that has carrier).

The "mostly ignore carrier" special handling for bridges and bonds is
now also handled as part of the NMDevice-level carrier handling.

https://bugzilla.gnome.org/show_bug.cgi?id=688284
2013-02-15 13:40:38 -05:00
Dan Williams
cc7e5cc591 dhcp: debug log generated DUID 2013-02-14 16:19:10 -06:00
Dan Williams
1b1b4bd91c dhcp: write DUID out to lease file if not already present
Ensure that dhclient uses the administrator-specified or machine-id
generated DUID.
2013-02-14 16:19:05 -06:00
Gene Czarcinski
c0efef8c92 dhcp: add special machine-id parse function
The original used uuid_parse() but that function did not
work properly since the format of the machine-id is
not compatable with a real uuid.  This patch adds a new
machine_id_parse() routine to correctly convert the
character string of hex digits to a 16 byte binary string.
2013-02-14 16:18:59 -06:00
Dan Winship
b54a4e601d core: fix a bug in NMSettingsConnection
nm_settings_connection_init() was calling nm_connection_set_path(),
but this was pointless since that would end up getting cleared by the
property's default value shortly after init() returned (and
claim_connection() depended on this). So remove that code.

https://bugzilla.gnome.org/show_bug.cgi?id=693829
2013-02-14 13:59:53 -05:00
Dan Winship
57327a6a57 libnm-util, libnm-glib: fix NMConnection:path again
24cda2bc broke the ability to set NMConnection:path back to NULL after
it had been set, as part of a hack to try to make
NMRemoteConnection:dbus-path work. Fix that by moving the hack
entirely into NMRemoteConnection.

https://bugzilla.gnome.org/show_bug.cgi?id=693829
2013-02-14 13:47:44 -05:00
Dan Winship
43f259ee1f libnm-glib: add NMDevice:available-connections
NMDevice has a D-Bus "AvailableConnections" property, but we weren't
exposing it on NMDevice. Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=693669
2013-02-14 09:31:33 -05:00
Dan Winship
24cda2bc36 libnm-util, libnm-glib: Make NMRemoteConnection instantiable by NMObject
In order to resolve NMRemoteConnection-valued properties, NMObject
needs to be able to create NMRemoteConnections. But NMObject assumes
that all the objects it will be creating have "dbus-connection" and
"dbus-path" properties. So add those properties to NMRemoteConnection,
aliasing the existing "bus" and "path" properties (and ensure that
whichever version gets set, we keep that value, rather than letting it
get overwritten by the NULL default value of the other one).

https://bugzilla.gnome.org/show_bug.cgi?id=693669
2013-02-14 09:31:33 -05:00
Dan Winship
7c5cf25366 libnm-glib: fix NMRemoteConnection GInitable implementation
apparently this never got tested...

https://bugzilla.gnome.org/show_bug.cgi?id=693669
2013-02-14 09:31:33 -05:00
Dan Winship
08f04466e8 all: remove more pointless NULL checks
GObject creation cannot normally fail, except for types that implement
GInitable and take a GError in their _new() method. Some NM types
override constructor() and return NULL in some cases, but these
generally only happen in the case of programmer error (eg, failing to
set a mandatory property), and so crashing is reasonable (and most
likely inevitable anyway).

So, remove all NULL checks after calls to g_object_new() and its
myriad wrappers.

https://bugzilla.gnome.org/show_bug.cgi?id=693678
2013-02-13 13:38:36 -05:00
Dan Winship
d04f286327 all: remove pointless NULL checks
g_malloc(), etc, never return NULL, by API contract. Likewise, by
extension, no other glib function ever returns NULL due to lack of
memory. So remove lots of unnecessary checks (the vast majority of
which would have immediately crashed had they ever run anyway, since
g_set_error(), g_warning(), and nm_log_*() all need to allocate
memory).

https://bugzilla.gnome.org/show_bug.cgi?id=693678
2013-02-13 13:38:13 -05:00
Yuri Chornoivan
d0bfd47dfb po: updated Ukrainian (uk) translation (bgo #693519) 2013-02-13 15:35:20 +01:00
Enrico Nicoletto
86a7fe61a8 po: updated Brazilian Portuguese (pt_BR) translation (bgo #693563) 2013-02-13 15:28:17 +01:00
Pavel Šimerda
018c387e2c workaround to build against libnl
This reverts commit ff15a5e and adds netlink.h header file so that
we build on all systems. We haven't propery analyzed which systems
are affected and which are not.
2013-02-13 13:34:45 +01:00
Dan Williams
3a2e6de0d3 wifi: ensure new supplicant is noticed if previous one quit quickly
If the Wifi device hadn't yet had a chance to transition away from
UNAVAILALBLE before the supplicant quit, the NMSupplicantInterface
would not be re-acquired becuase that was only happening from
the device state change handler when entering the UNAVAILALBE state,
and clearly setting the same state is NOP.

Since the old supplicant interface was torn down, and the wifi device
hadn't created a new supplicant interface (because it hadn't changed
state) nothing was listening for the supplicant to appear.

Fix that by ensuring that the wifi device reacquires a supplicant
interface whenever an old one is torn down and the device is enabled.

NetworkManager[3062]: <info> (wlan0): supplicant interface state: scanning -> down
NetworkManager[3062]: <info> (wlan0): device state change: config -> unavailable (reason 'supplicant-failed') [50 20 10]
NetworkManager[3062]: <info> (wlan0): deactivating device (reason 'supplicant-failed') [10]
NetworkManager[3062]: <info> wpa_supplicant started
NetworkManager[3062]: <info> wpa_supplicant stopped
NetworkManager[3062]: <info> (wlan0): supplicant interface state: starting -> down
<start new supplicant, nothing happens>
2013-02-12 16:13:00 -06:00
Dan Williams
4973da78e4 core: remove unused SIGUSR1 handling 2013-02-12 15:41:52 -06:00
Dan Winship
414af39c3c keyfile: fix some test error message cut+paste errors 2013-02-12 15:50:20 -05:00
Jiří Klimeš
76b5e24ac9 build: fix build with --enable-doc (docs/api/Makefile.am)
"./autogen.sh --enable-doc && make" produced this error:
warning: failed to load external entity "../settings-spec.xml"
../network-manager-docs.xml:57: element include: XInclude error : could not load ../settings-spec.xml, and no fallback was found

Removing settings-spec.xml from $(content_files) made the file non-DISTed but it
also removed the file as a dependency for html-build.stamp that also runs
cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
and $(DOC_MAIN_SGML_FILE) includes settings-spec.xml.

Fix that by making $(DOC_MAIN_SGML_FILE) dependent on setting-spec.xml.
2013-02-12 17:25:20 +01:00
Dan Williams
abfb8374d1 release: bump version to 0.9.9.0 (development) 2013-02-12 09:43:49 -06:00
Jiří Klimeš
2c69caf2d5 policy: use private 'dns_manager' member to simplify code a bit 2013-02-12 15:47:13 +01:00
Jiří Klimeš
07c5651a36 policy,dns: fix a race in looking up hostname and updating DNS (rh #877084)
"config-changed" signal is added to dns-manager and emited when resolv.conf is
changed. Policy listens for the signal and restarts reverse-lookup in order to
get correct results.
2013-02-12 15:40:08 +01:00
Jiří Klimeš
32b38693f1 cli: show AP and ADHOC support in WIFI-PROPERTIES for Wi-Fi devices 2013-02-12 10:01:31 +01:00
Pavel Šimerda
6187b39795 trivial: fix gir warning 2013-02-12 01:25:30 +01:00
Dan Williams
e5f8b426bf settings: load keyfile plugin even if no plugins are given
If no config file was specified, and if no other plugins were given
on the command-line, the keyfile plugin would not be loaded.  This
meant no connections would be read, and no connections could be
created either.

Always load the keyfile plugin.
2013-02-11 15:45:48 -06:00
Dan Williams
6cba496a4f wifi: don't warn on unknown nl80211 ciphers 2013-02-11 15:38:04 -06:00
Dan Williams
aa5013cf2d core: fix duplicating (not removing) active connections
This is a regression introduced by reworked active connections tracking:
7258dd270f core: add the NM_ACTIVE_CONNECTION_STATE_DEACTIVATED state
59420add04 core: track active connections directly in the manager

Because nm-manager.c:active_connection_state_changed() postpones active
connection removal to an idle handler (to be able to receive last property
change notifications), we also need to ensure that NM_ACTIVE_CONNECTION_STATE_DEACTIVATED
state is not changed again in the meantime in nm-activation-request.c:device_state_changed().
After the NMActRequest was deactivated (which is a terminal state) it was still
listening to state changes of its child NMDevice which could be starting a
new activation request.  Thus the new activation's NMDevice state would cause
the old activation request's state to change from DEACTIVATED.  To fix this
stop listening to the child NMDevice when DEACTIVATED becuase there's no point
to doing so anyway.

Reproducer:
Just activate already active connection by clicking it in nm-applet or
run 'nmcli con up id <connnection name>' several times, and then check
active connections with 'nmcli c s'.
2013-02-11 11:48:11 -06:00
Dan Williams
527cbf1924 Revert "core: fix duplicating (not removing) active connections"
This reverts commit df796527a4.

We found the real problem.
2013-02-11 11:48:11 -06:00
Dan Winship
fc700e9213 core: add NM_WIFI_DEVICE_CAP_ADHOC
Some wireless devices don't support Ad-Hoc mode. Expose this fact in
the wireless capabilities so that clients can disable the hot-spot
option if neither CAP_ADHOC nor CAP_AP is available.

https://bugzilla.gnome.org/show_bug.cgi?id=692869
2013-02-11 12:39:28 -05:00
Jiří Klimeš
df796527a4 core: fix duplicating (not removing) active connections
This is a regression introduced by reworked active connections tracking:
7258dd270f core: add the NM_ACTIVE_CONNECTION_STATE_DEACTIVATED state
59420add04 core: track active connections directly in the manager

Because nm-manager.c:active_connection_state_changed() postpones active
connection removal to an idle handler (to be able to receive last property
change notifications), we also need to ensure that NM_ACTIVE_CONNECTION_STATE_DEACTIVATED
state is not changed again in the meantime in nm-activation-request.c:device_state_changed().

Reproducer:
Just activate already active connection by clicking it in nm-applet or
run 'nmcli con up id <connnection name>' several times, and then check
active connections with 'nmcli c s'.
2013-02-11 14:03:17 +01:00
Jiří Klimeš
17aff29082 cli: add NM_ACTIVE_CONNECTION_STATE_DEACTIVATED state-to-string translation 2013-02-11 13:00:02 +01:00
Jiří Klimeš
d9c1fb176d include: document NM_DEVICE_TYPE_BRIDGE device type 2013-02-11 12:55:05 +01:00
Michael Biebl
28520ac865 build: AC_CONFIG_FILES are automatically part of "make dist"
No need to add those explicitly to EXTRA_DIST
2013-02-09 18:16:24 +01:00
Colin Walters
6ea196de0e man: Fix previous commit to honor --disable-doc
In that mode, we shouldn't attempt to generate any manpages.  While
we're here, rewrite this file (using nonrecursive style) so we don't
install non-generated ones either.

Signed-off-by: Colin Walters <walters@verbum.org>
2013-02-09 18:08:23 +01:00
Michael Biebl
51c6338329 build: Don't install generated xml file as man page 2013-02-09 17:10:20 +01:00
Dan Williams
6431df02d4 trivial: remove unused gdb-cmd
No longer used after the removal of the internal crash dumper.
2013-02-08 23:54:16 -06:00