Commit Graph

15047 Commits

Author SHA1 Message Date
Jiří Klimeš
a78386b6d1 team: start teamd when ensuring team connection else teamdctl_connect() fails
Check if teamd is already running before trying to connect, else it would fail
anyway with errors:
libteamdctl: teamdctl_connect: Failed to connect using all CLIs.
NetworkManager[5535]: <error> [1402495644.226625] [devices/nm-device-team.c:208] ensure_teamd_connection(): (TTT): failed to connect to teamd (err=-22)

 # ip link set name TTT type team
2014-06-23 15:20:27 +02:00
Jiří Klimeš
4ece719beb team: set connection type for class, else the generating connection is invalid 2014-06-23 15:20:27 +02:00
Jiří Klimeš
206753fed8 team: don't pass priv parameter to functions, get it when needed 2014-06-23 15:20:27 +02:00
Jiří Klimeš
e554ef606f ifcfg-rh: write GATEWAY instead of GATEWAY0 to be ifup-compatible (rh #771673)
https://bugzilla.redhat.com/show_bug.cgi?id=771673
https://bugzilla.redhat.com/show_bug.cgi?id=1105770
2014-06-23 15:00:54 +02:00
Piotr Drąg
f5681d15ba po: update Polish (pl) translation (bgo #732013)
https://bugzilla.gnome.org/show_bug.cgi?id=732013

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-23 12:13:01 +02:00
Thomas Haller
3789e45428 core: ensure boolean properties for nm_active_connection_set_default[6]() are either TRUE or FALSE
Since @is_default is compared using ==, we should ensure that the
boolean properties are always either TRUE or FALSE.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-20 17:56:06 +02:00
Dan Williams
5a4e42bc51 examples: add Python dbus example indicating if WWAN is the default connection 2014-06-20 10:54:03 -05:00
Thomas Haller
0d45284aa7 dispatcher: suppress log warning when nm-dispatcher is disabled in systemd
When 'nm-dispatcher' is not running because its systemd service
'NetworkManager-dispatcher.service' is not enabled, any calls to the dispatcher
will fail with an error of typ DBUS_ERROR:DBUS_GERROR_REMOTE_EXCEPTION (32):

  "Unit dbus-org.freedesktop.nm-dispatcher.service failed to load: No such file or directory."

This clutters the logfile with warnings, although the user probably
disabled the service on purpose.

Special case this particular (recurring) failure and downgrade the warning
to debug level.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-20 17:25:01 +02:00
Dan Winship
73508704d8 wifi: fix WoWLAN detection
WoWLAN state has to be requested by phy, not by ifindex

Related: rh#1025009
2014-06-20 11:15:25 -04:00
Jiří Klimeš
530412134d cli: make "(not available)" translatable 2014-06-20 13:58:36 +02:00
Jiří Klimeš
142e2c4726 build: fix gobject-introspection detection
so that HAVE_INTROSPECTION is properly defined
2014-06-20 13:58:36 +02:00
Thomas Haller
aaf0ef42dd nm-online: refactor calculation of wait timeout for better accuracy
Also, in verbose mode, synchronize the printing of the progress
bar and the counting seconds so that the output appears smooth.

This schedules the timeouts so that there are roughly
(PROGRESS_STEPS + n_secs) wakeups.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-20 08:15:37 +02:00
Dan Winship
9a06f1a2eb libnm-util: drop GParamSpec docs, use gtk-doc docs elsewhere
https://bugzilla.gnome.org/show_bug.cgi?id=731406
2014-06-19 17:45:03 -04:00
Dan Winship
aa1dce6da2 all: remove remaining GParamSpec name/blurb strings
Remove all remaining GParamSpec name and blurb strings (and fix
indentation while we're there), and add G_PARAM_STATIC_STRINGS to all
paramspecs that were lacking it.
2014-06-19 17:45:03 -04:00
Dan Winship
cdc15cb2a6 libnm-util: remove NMSetting* GParamSpec docs
Remove all the GParamSpec docs, since everything now uses the gtk-doc
docs instead, so there's no point in having two copies of each (which
are often out of sync anyway).

Since we're touching so many lines anyway, also fix up the indentation
of the remaining property-installing lines, and add
G_PARAM_STATIC_STRINGS to each paramspec (so the nick strings don't
get strduped). Also, be consistent about starting a new line between
"g_object_class_install_property" and its opening parenthesis.
2014-06-19 17:45:03 -04:00
Dan Winship
8252ebd941 cli: generate setting docs from libnm-util/nm-setting-docs.xml
nmcli used the GParamSpec doc strings to get property descriptions,
but they will be going away. Generate a .c file from the new XML
setting docs file, and link that into nmcli.
2014-06-19 17:45:02 -04:00
Dan Winship
07bb19a3bb tools: remove generate-settings-spec, which is no longer used 2014-06-19 17:45:02 -04:00
Dan Winship
cceb773510 docs: generate settings-spec.xml from libnm-util/nm-setting-docs.xml
Generate docs/api/settings-spec.xml via an XSLT stylesheet applied to
libnm-util/nm-setting-docs.xml.
2014-06-19 17:45:02 -04:00
Dan Winship
a3d02ddeef man: generate nm-settings.xml from libnm-util/nm-setting-docs.xml
Generate man/nm-settings.xml via an XSLT stylesheet applied to
libnm-util/nm-setting-docs.xml.
2014-06-19 17:45:02 -04:00
Dan Winship
dcc109516d libnm-util: build nm-setting-docs.xml from gtk-doc and GParamSpecs
Add generate-setting-docs.py, based on tools/generate-settings-spec.c,
which generates a simple XML file describing all libnm setting
properties (still getting the default values via GParamSpec
introspection like generate-settings-spec.c does, but getting the
documentation out of the gtk-doc strings in the GIR file instead).
2014-06-19 17:45:02 -04:00
Dan Winship
e8577083ca libnm-util: various NMSetting* property doc fixes/improvements
Fix up various issues with the docs for the NMSetting properties, and
pull in text from the GParamSpec docs where the GParamSpec docs were
better (or contained information that is necessary in the context of
nm-settings.5).

Also, consistently wrap all of the doc comments to the same width (80
columns).
2014-06-19 17:45:02 -04:00
Dan Winship
9de24b16e8 libnm-util: fix gtk-doc bugs in NMSetting* properties
Fix misused gtk-doc annotations and incorrectly-identified properties.

In particular, the upcoming introspection-based generate-settings-spec
expands macro and enum values, so if you use '%' where you should have
used '#', it will fail to find an expansion, and error out.
2014-06-19 17:45:02 -04:00
Dan Winship
8487a4490c libnm-util, libnm-glib: be consistent about "Wi-Fi", "Ethernet", "InfiniBand" in docs
We made the UIs consistent last year, but missed the documentation.
Fix the docs to also consistently use "Wi-Fi" rather than "WiFi",
"Wifi", "wifi", or "WiFI"; "Ethernet" rather than "ethernet"; and
"InfiniBand" rather than "Infiniband".
2014-06-19 17:45:01 -04:00
Thomas Haller
7475d8c28d platform: merge branch 'th/bgo727382_platform_fix_addr_lifetime' (part 2)
https://bugzilla.gnome.org/show_bug.cgi?id=727382

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 23:20:43 +02:00
Thomas Haller
6f013183e8 platform: extend nm_platform_ip_address_cmp_expiry() to handle addresses without timestamp
If the timestamp is set to zero, the to_string() functions treat the lifetime
as based on *now*. For nm_platform_ip_address_cmp_expiry() this makes no
sense, because there is no absolute exiry to compare. Instead compare
them as expire earlier then the other address.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:26:10 +02:00
Thomas Haller
c6d45a4083 platform: modify address to_string() to show raw lifetime values
The "lifetime" part when printing an address in nm_platform_ip[46]_address_to_string()
is supposed to show the raw, internal values of the address.

We already have the "lft" and "pref" output that presents the expiries based on now.
These fields are already crafted to show what the user probably wants
to see when looking at debugging log. "lifetime" should not do any
special casing and just print the raw values.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:26:10 +02:00
Thomas Haller
c29496125f platform: handle unset address timestamp as *now* in to_string()
When printing an address in nm_platform_ip4_address_to_string()
and nm_platform_ip6_address_to_string() treat an unset @timestamp
as counting from @now.

This is useful, if you just have the remaining lifetime at hand
and want to print an address. In general it is not a good idea to
leave the timestamp not anchored to an absolute @timestamp.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:26:10 +02:00
Thomas Haller
a2791f54da platform: set timestamp in platform addresses to last_update_time()
Previous patch 8310a039d8 modified
platform to set the timestamp of addresses always to 1.

So, when adding an address platform logging looked like:
  signal: address 4 added: 192.168.232.3/24 lft 2000sec pref 1000sec lifetime 12345-1[13344,14344] dev em1 src kernel

This is confusing in the log file and during debugging. Instead set the
timestamp to the last modification time of the address so that it will
look like:
  signal: address 4 added: 192.168.232.3/24 lft 2000sec pref 1000sec lifetime 12345-12345[1000,2000] dev em1 src kernel

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:26:10 +02:00
Thomas Haller
31db488396 platform: fix off-by-two error converting lifetimes in _init_ip_address_lifetime()
When setting the timestamp to 1, we have to subtract(!) one second
from a_valid and a_preferred.

Due to this error, NM saw the lifetimes of addresses from system as two
seconds larger then the actual value.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:13:48 +02:00
Thomas Haller
6723745fe0 dhcp: nm_dhcp_dhclient_read_lease_ip_configs() must anchor the address lifetime at *now*
nm_dhcp_dhclient_read_lease_ip_configs() calculates the remaining time
until the address expires. It must anchor the lifetimes by setting the
@timestamp to nm_utils_get_monotonic_timestamp_s().

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:13:48 +02:00
Thomas Haller
5174976cc1 platform/test: use proper to_string() functions when printing NMPlaformIP[46]Address in dump_interface()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:13:48 +02:00
Thomas Haller
ca85ecd145 contrib/rpm: fix typo in spec file (wrong option --enable-teamdctl)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 12:49:14 +02:00
Jiří Klimeš
f227d25ed9 cli: clarify nmcli description for route metric 2014-06-19 10:04:08 +02:00
Jiří Klimeš
7c41835203 cli: editor - do not print separator when printing one setting 2014-06-19 09:24:07 +02:00
Jiří Klimeš
9ab59bdfac cli: editor - enhance TAB completion for 'print' command 2014-06-19 09:24:07 +02:00
Jiří Klimeš
e7830c7925 cli: editor - enhance 'print' command
- allow printing single properties:
nmcli> print con.id
connection.id: my-main-ethernet

- allow printing other settings in second (settings) menu level:
nmcli connection> print ipv4.method
ipv4.method: auto
nmcli connection> print eth
...
2014-06-19 09:23:07 +02:00
Thomas Haller
bf0b08ad55 contrib/rpm: improve usage output of build_clean.sh script
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-18 10:49:51 +02:00
Thomas Haller
02747203c6 dispatcher: silence warning about sub-directories in dispatcher directory
Especially now that we have the 'pre-up.d/' and 'pre-down.d/' directories,
silently skip over any sub directories inside the dispatcher directory.

Fixes warning:
  nm-dispatcher: Cannot execute '/etc/NetworkManager/dispatcher.d/pre-up.d': not a regular file.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-17 19:15:31 +02:00
Thomas Haller
589272facf dispatcher: fix leak in callouts/nm-dispatcher
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-17 19:09:56 +02:00
Michael Biebl
ec1034a03a build: fix bashisms in configure.ac
[[ && ]] is a bashism, so use [ ] && [ ] instead.
Also use readlink -f instead of realpath, since the latter is not
guaranteed to be installed.
2014-06-17 11:33:50 -05:00
Thomas Haller
d71ec13123 core: merge branch 'th/bgo731570_master_slave'
https://bugzilla.gnome.org/show_bug.cgi?id=731570

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-16 19:20:33 +02:00
Thomas Haller
0a7a7f5e4d dispatcher: better detection for dispatcher scripts
Previously, we would not check the content of the script directory.
This meant, that "/etc/NetworkManager/dispatcher.d" almost always
contained something, namely the "pre-up.d" and "pre-down.d" directories.

Improve that by searching the directories for at least one
executable file.

Also, debug log the detected state of the dispatcher directories.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-16 19:19:10 +02:00
Thomas Haller
c674f26cd1 dispatcher: for debug logging, truncate the (expected) script name when showing dispatcher results
Only truncate the script name to "basename" if the directory is the expected
one. Otherwise we print the raw value as returned by the dispatcher service.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-16 19:18:57 +02:00
Thomas Haller
0c54ab217e dispatcher: skip callouts for empty script directory based on dispatcher action type
Before, there was only one combined variable checking whether any dispatcher scripts
are present at all. This meant for example, that a call to PRE_UP was still sent out
even if no scripts were in pre-up.d/ directory.

Optimize this, by distinguishing between the dispatcher type and the script directories.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-16 19:18:57 +02:00
Thomas Haller
10780592c8 dispatcher/trivial: move code
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-16 19:18:57 +02:00
Thomas Haller
b317e79b5b dispatcher: improve debug logging for dispatcher callouts
- ensure, that dispatcher_results_process() logs a line even if no scripts
were run. This way we alyways know when the callout returns.

- log a line when cancelling a dispatcher call

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-16 19:18:57 +02:00
Thomas Haller
c8e7953333 dispatcher/trivial: rename variables for script directory to NMD_SCRIPT_DIR_* 2014-06-16 19:18:57 +02:00
Thomas Haller
afecbf1f66 device: refactor by combining dispatcher callback functions
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-16 19:18:57 +02:00
Thomas Haller
851be22146 core/trivial: move code
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-16 19:18:57 +02:00
Thomas Haller
524fc6d454 core: preserve reason on device deactivation while pre-down (fix tearing down slave when deactivating master)
When delaying the deactivation of a device during dispatcher-pre-down,
we must preseve the reason to pass it on.

This is especially important, because nm_device_slave_notify_release()
checks for the reason, and does not deactivate the slave if no reason is
given. This error caused slaves the be left up when deactivating the master.

Also update the call to nm_device_slave_notify_release() to ensure we
have a valid state reason when configuring the slave. This would have
pointed out the issue and would even work around it.

Regression introduced by commit d00e2147de.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-16 19:18:57 +02:00