Commit Graph

7740 Commits

Author SHA1 Message Date
Dan Winship
2a617267d1 build: fix srcdir!=builddir 2013-05-03 09:22:58 -04:00
Dan Winship
bb9b276278 platform: use g_assert_cmpint() and g_assert_cmpstr() in tests
"g_assert_cmpint (x, ==, y)" is nicer than "g_assert (x == y)",
because if it fails, it shows you the values of x and y in the assert
message. Likewise g_assert_cmpstr().

The "ifindex > 0" checks still just use g_assert(), since we don't
need to distinguish specific negative values there.
2013-05-03 08:39:19 -04:00
Dan Winship
4d32618264 libnm-util: handle "empty" connection-type settings correctly
nm_setting_to_hash() would return NULL if the setting had entirely
default values, but this effectively meant that you could never have a
connection whose "connection type" setting (eg, NMSettingWired) had
all default values. (This ended up not usually being a problem in
practice because most such settings had at least one property with a
mandatory string value where the GObject property had a default value
of NULL.)

However, NMSettingGeneric will have no properties, so it would always
get stripped out when converting to a hash, invalidating the
connection. Fix that.
2013-05-03 08:39:10 -04:00
Dan Winship
6cb786f569 libnm-util: move setting priority functions to nm-setting.c
None of these take an NMConnection; they logically belong in
NMSetting.
2013-05-03 08:39:06 -04:00
Dan Winship
283b8fb7d0 platform: add ifindex arg to NMPlatform signals
In some cases, callers don't need to distinguish, eg,
ip4-address-added from ip6-address-added, but just need to know what
device the event occurred on. Make this simpler by including the
ifindex as a separate explicit argument, allowing callers to just
ignore the struct part.
2013-05-03 08:39:00 -04:00
Dan Winship
f92ce56739 core: add "assumed" arg to nm_device_set_ip6_config()
Although the code still does not support assuming IP6 configurations,
add an "assumed" flag to this function, to match
nm_device_set_ip4_config().
2013-05-03 08:38:51 -04:00
Jiří Klimeš
c35dda8727 libnm-util: fix the maximal value for gsm 'allowed-bands' property
The bitfields have to be OR-ed with the bitwise |, not ||.
2013-05-03 10:11:56 +02:00
Jiří Klimeš
bfc20af513 libnm-util: fix WEP key type comparison in nm_utils_wep_key_valid() 2013-05-03 10:11:56 +02:00
Dan Williams
22d2f571ce core: ensure ActiveConnections are torn down when device is unavailable (bgo #676285)
If a device becomes unmanaged or unavailable (eg, due to loss of carrier, becoming
unmanaged, rfkilled, supplicant crashing, etc), the ActiveConnection would simply
set state to UNKNOWN and the Manager wouldn't tear it down and remove it from the
ActiveConnections property list. Instead, these states should be treated the same
as if the device was deactivated cleanly so that the AC will accurately reflect
the device state and the Manager will clean the AC up.

Fixes comment #12 in:
https://bugzilla.gnome.org/show_bug.cgi?id=676285
2013-05-02 14:44:01 -05:00
Dan Winship
b39b4e9cf3 man: fix distcheck
Also, we can get rid of tools/manpages-docbook.xsl and just specify
the canonical URL directly.
2013-05-02 11:40:21 -04:00
Jiří Klimeš
2699de9383 man: nmcli manual page - remove references to D-Bus API
It doesn't belong to the man page and is not much beneficial for most users
anyway.
2013-04-30 09:44:41 +02:00
Jiří Klimeš
47710f8211 cli: 'con up' - give bond/bridge slaves 10s to appear while activating master
If there are no slaves after the timeout, exit nmcli with an error, assuming
that NM is waiting for slaves to finish activation:
"(bondx) "IPv4 config waiting until slaves are ready"
"(bondx) "IPv6 config waiting until slaves are ready"
2013-04-30 09:28:13 +02:00
Pavel Šimerda
5277719dce trivial: add gitignore for qt examples 2013-04-29 14:14:11 +02:00
Pavel Šimerda
3545a89a99 platform: update gitignore for tests 2013-04-29 14:13:50 +02:00
Pavel Šimerda
a313da882a platform: suppress kernel's automatic creation of bond0 (rh #953466)
Which it does whenever the 'bonding' module gets loaded no matter
what name the user wants to give the new bond interface.

Ported nm-system fix from commit 7cc95d8, using system() to avoid
dependency on NM libs.

Automatic test included. You have to run 'rmmod bonding' before testing
to ensure that the module is not already inserted. Second run without
rmmod always succeeds.
2013-04-29 14:05:01 +02:00
Pavel Šimerda
1929471d5f platform: use NMPlatformError type instead of int 2013-04-29 14:00:26 +02:00
Jiří Klimeš
a6a330581c man: update nmcli man page description for 'connection down' 2013-04-29 10:21:59 +02:00
Jiří Klimeš
57a2dbd640 man: put back '\-' instead of nicer '\(en' in NAME section to shut up lexgrog
mandb is completely OK with nice En dash.
2013-04-29 09:36:27 +02:00
Sweta Kothari
a9a1698cf1 po: updated Gujarati (gu) translation (bgo #698714) 2013-04-29 08:11:57 +02:00
Nilamdyuti Goswami
ef6e6a3d36 po: updated Assamese (as) translation (bgo #698565) 2013-04-29 08:11:57 +02:00
etc
e764fb82dc po: add Turkish (tr) translation (bgo #697434) 2013-04-29 08:11:57 +02:00
Krishna Babu K
a2b93beaf5 po: updated Telugu (te) translation (bgo #696576) 2013-04-29 08:11:57 +02:00
Ani Peter
9522ab3c7c po: updated Malayalam (ml) translation (bgo #696555) 2013-04-29 08:11:57 +02:00
Shankar Prasad
e7105442a6 po: updated Kannada (kn) translation (bgo #696566) 2013-04-29 08:11:57 +02:00
Yuri Chornoivan
68984007ee po: updated Ukrainian (uk) translation (bgo #698219) 2013-04-29 08:11:57 +02:00
Dan Williams
7cc95d89a6 core: suppress kernel's automatic creation of bond0 (rh #953466)
Which it does whenever the 'bonding' module gets loaded no matter
what name the user wants to give the new bond interface.
2013-04-26 17:30:19 -05:00
Martin Pitt
39a0c81aa5 configure: Check libsystemd-login version for suspend-resume
Some distributions (Debian and Ubuntu in particular) will soon use systemd's
logind, but not its init part. Check for a recent enough "libsystemd-login"
version instead of "systemd", as suspend/resume and inhibitors are all in
logind.

https://bugzilla.gnome.org/show_bug.cgi?id=698947
2013-04-26 10:52:24 -04:00
Tim Lunn
190d8aa840 build: fix session tracking for systemd in configure.ac
https://bugzilla.gnome.org/show_bug.cgi?id=698706
2013-04-24 16:13:47 -04:00
Colin Walters
34c88dd8e4 man: rewrite NetworkManager.8 and NetworkManager.conf.5 in DocBook
DocBook is not my favorite thing in the world, but it's
<lots-of-emphasis>far</lots-of-emphasis> saner than troff.  Some style
parts cribbed from systemd.

This is preparatory work for actually improving the content of the
man pages.
2013-04-24 11:44:50 -05:00
Pavel Šimerda
a3d6a825df coverage: delete *.gcno on make clean 2013-04-24 14:50:04 +02:00
Jiří Klimeš
8215fd92fc cli: rename 'nmcli dev wifi scan' to 'nmcli dev wifi rescan' (bgo #698241) 2013-04-24 10:22:57 +02:00
Jiří Klimeš
3560024de9 cli: remove obsolete 'nmcli nm'
The functionality is present in 'general', 'networking' and 'radio'.
We changed syntax anyway, so it doesn't make much sense to keep 'nm'.
2013-04-24 10:04:43 +02:00
Jiří Klimeš
3bf97fafe7 cli: rename 'iface' --> 'ifname' in all commands 2013-04-24 10:04:37 +02:00
Jiří Klimeš
5f523d8f4d cli: accept shortcuts for --mode and --escape arguments
--mode tabular | multiline  -->  --mode t | m
--escape yes | no           -->  --escape y | n
2013-04-24 10:04:33 +02:00
Dan Williams
ef151c3f04 core: fix memory leak
get_virtual_iface_name() returns an allocated interface name which
we must free; that wasn't being done when attempting to find the
interface for which a virtual interface needs to be created.  Also
throw in a cleanup for the given-device-doesn't-exist case just to
make it clearer when the interface name is freed.
2013-04-23 14:01:24 -05:00
Jiří Klimeš
ac6543305e config: fix a crash in nm_config_device_get_hwaddr()
get_hw_address (nm_device_get_hw_address()) asserts and then SIGSEGV
happens in nm_utils_hwaddr_ntoa().

Found by pavlix in NM live VM.
2013-04-23 18:47:30 +02:00
Jiří Klimeš
841c259119 libnm-util: make nm_connection_replace_settings_from_connection() safer
When 'connection' and 'new_connection' arguments are the same object make the
function no-op and simply return true. Otherwise 'connection's settings are
removed, making it invalid.

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2013-04-22 10:15:53 -05:00
Pavel Šimerda
f5507633f8 platform: bridging and bonding options 2013-04-20 03:43:25 +02:00
Pavel Šimerda
359dc35aa3 platform: setter/getter of /proc/sys and /sys options 2013-04-20 03:43:25 +02:00
Pavel Šimerda
81bf475b78 platform: master and slave devices 2013-04-20 03:43:25 +02:00
Dan Winship
649d2e4c1b libnm-util: fix doc bug in NMSettingIP6Config 2013-04-19 15:37:48 -04:00
Dan Winship
ac50fc2642 build: update Makefile.glib
If a SOURCES variable changes, we need to recheck the generated files,
since a file may have been removed from SOURCES, but still be
referenced in a previously-generated -enum-types.c file, etc. So make
these generated files depend on Makefile.

Also, update spacing of silent rules to match current automake.
2013-04-19 10:52:21 -04:00
Martin Pitt
57a9fb3c89 Use %NULL macro in doc strings
Mass-converted "NULL" to "%NULL" in docstrings with

  find -name '*.c'| xargs sed -i '/^ \*.*[^%]NULL/ s/NULL\b/%NULL/g'
2013-04-19 10:08:17 -04:00
Martin Pitt
6226fb9b59 libnm-util: Fix transfer annotations of nm_{connection,setting}_need_secrets()
The various need_secrets() implementation do allocate a fresh GPtrArray, but
add static strings to them without dup'ing. Thus callers must _not_ free the
array elements, only the array itself. Adjust documentation and annotations
accordingly.

Also adjust the corresponding comment in the goi-list-connections.py example.

https://bugzilla.gnome.org/show_bug.cgi?id=698175
2013-04-19 09:43:56 -04:00
Martin Pitt
d5fb24b5b5 libnm-glib: Make SecretAgent introspectable
Use the correct annotation for vfuncs, so that NMClient.SecretAgent becomes
introspectable.

Use "self" as the first argument of the vfuncs in their declarations, to match
the actual name in nm-secret-agent.c. This avoids warnings from g-ir-scanner.

https://bugzilla.gnome.org/show_bug.cgi?id=698184
2013-04-19 09:40:32 -04:00
Jiří Klimeš
d3ea9ee472 cli: handle NULL gracefully in nmc_arg_is_help() 2013-04-18 12:42:54 +02:00
Jiří Klimeš
4950abfb87 trivial: update comments for 'new' --> 'new_connection' renaming 2013-04-18 11:38:08 +02:00
Jiří Klimeš
7d5df73d76 cli: add nmc_arg_is_help() and use it to save some code lines 2013-04-18 11:25:49 +02:00
Dan Williams
83baf86a27 core: use nm_connection_replace_settings_from_connection()
And consolidate some of the code; we never need to replace the
connection's settings if nothing has changed.
2013-04-17 12:23:34 -05:00
Dan Williams
bafd0d557d libnm-util: add nm_connection_replace_settings_from_connection() (bgo #696387)
Convenience function to replace settings in one conneciton with settings
from another, without having to go through the nm_connection_to_hash()
steps, which are just inefficient and kinda pointless.
2013-04-17 12:23:34 -05:00