Commit Graph

10267 Commits

Author SHA1 Message Date
Thomas Haller
4a22cefc6c core: add configuration main.debug and interpret environment variable NM_DEBUG
Interpret the configuration option main.debug and the
environment variable NM_DEBUG as a comma separated list
of debugging options (parsed with g_parse_debug_string()).

Currently only the option "RLIMIT_CORE" is supported, to set
the core dump size to unlimited.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-02 11:08:14 +02:00
Thomas Haller
f5b82f49dd core: merge branch 'th/rh1086906_start_complete_for_dynamic_ip'
https://bugzilla.redhat.com/show_bug.cgi?id=1086906

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-01 22:09:05 +02:00
Thomas Haller
516d66210f core: wait with "startup complete" for both IPv4 and IPv6 dynamic configuration
In case of DHCP4, DHCP6 and/or SLAAC, delay "startup complete" until
both IPv4 and IPv6 are ready. This especially has an effect on
nm-online/NetworkManager-wait-online.service, which blocks until
configuration of both IPv4 and IPv6 is ready.

We queue a pending_action when automatic configuration starts and
remove it again, when we receive an address. Before, "startup complete"
was reached when either one of the two IP protocols was configured.

https://bugzilla.redhat.com/show_bug.cgi?id=1086906

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-01 22:06:52 +02:00
Thomas Haller
a16faa3985 core: add parameter to ignore error in add/remove pending action
Add a parameter to nm_device_add_pending_action() to silently
accept adding duplicate actions.

Same for nm_device_remove_pending_action(), to silently ignore
removing non-pending actions.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-01 22:06:52 +02:00
Dan Winship
50bafeaf2e dns-manager: fix the rules for public suffixes and search domains (rh #851521)
dfe194ee made it so that we don't use "public suffixes" as resolv.conf
search domains (eg, we don't add "search com" if the hostname is
"example.com"). However, if this results in us writing a resolv.conf
with no "search" line at all, then the resolver will fall back to
using the parent domain of the hostname as a search domain anyway,
thwarting us.

To fix that, use the domain itself as a search domain in this case,
since that's likely to be the expected behavior anyway. (And even if
it's not, there doesn't appear to be any way to block the resolver
from using the hostname's parent domain as a search domain unless we
specify at least one search domain ourselves.)

https://bugzilla.gnome.org/show_bug.cgi?id=729137
2014-04-29 14:47:25 -04:00
Dan Winship
93c10a6eea dns-manager: don't write "domain" to resolv.conf
resolv.conf(5) says:

    The domain and search keywords are mutually exclusive.  If more than
    one instance of these keywords is present, the last instance wins.

NM always writes out a "search" line if it writes a "domain" line, so
the "domain" line is always a no-op. So drop it.

https://bugzilla.gnome.org/show_bug.cgi?id=729137
2014-04-29 14:47:25 -04:00
Dan Winship
7f5b2f81b0 tui: fix route editing (rh #1090422)
NmtRouteTable's ip4-routes and ip6-routes properties have the
D-Bus-based route list types (like the corresponding NMSetting
properties) so we have to convert our GSList-of-NMIP[46]Route data
into those types when updating the property.

https://bugzilla.gnome.org/show_bug.cgi?id=728958
2014-04-29 10:36:54 -04:00
Dan Williams
b77b7510d6 examples: update 70-wifi-wired-exclusive.sh (bgo #513488)
Tighten up with suggestions from  Johannes Buchner and mention
his contribution.

Also fixes operation with current nmcli since it changed from
"802-3-ethernet" -> "ethernet" and thus the script was broken.

https://bugzilla.gnome.org/show_bug.cgi?id=513488
2014-04-28 17:07:02 -05:00
Peter Wu
a2eb4789ac platform: set link scope for IP4LL addresses
https://bugzilla.gnome.org/show_bug.cgi?id=728595

[thaller@redhat.com: minor change in coding style]
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-27 15:32:07 +02:00
Dan Winship
c0254336ce introspection: fix Device.Ip4Address type
https://bugzilla.gnome.org/show_bug.cgi?id=720963
2014-04-25 12:58:12 -04:00
Dan Winship
0c2586a786 tui: fix title of "Edit Connection" form (rh #1090397)
Form titles should be in titlecase; this was the only one that wasn't.
2014-04-25 11:22:38 -04:00
Dan Winship
a54fa87108 ifcfg-rh: fix alias tests to not depend on directory read order
test_read_wired_aliases_bad() would succeed or fail depending on the
order that ifcfg-aliasem1:1 and ifcfg-aliasem1:2 got read from disk.
Fix this by splitting it into two separate tests, each with only a
single alias.
2014-04-25 11:22:15 -04:00
Thomas Haller
6ba897120c Merge branch 'th/bg728320_coverity'
Fix bugs (memory leaks and potential crashes), found using coverity.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 21:22:29 +02:00
Thomas Haller
cf96ced717 ifcfg-rh: fix leak in svOpenFileInternal()
Error found by coverity.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 21:18:44 +02:00
Thomas Haller
628e774ba8 ifcfg-rh: fix crash for reading invalid bridge configuration
Error found by coverity.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 21:18:44 +02:00
Thomas Haller
73d4edb0b7 core: fix leaks for nm_setting_ip[46]_config_add_\(route\|address\)()
Error found by coverity.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 21:18:08 +02:00
Thomas Haller
f19e79cd7a core: fix potential crash in nm-dhcp-client
Error found by coverity.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 21:18:08 +02:00
Thomas Haller
9305c5bbf7 man/cli: add missing log domains to manual page and nmcli bash completion
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 17:27:47 +02:00
Jiří Klimeš
f69842aa57 tui: fix a crash when connecting to a password-secured Wi-Fi (rh #1090773)
'dialog' and 'co' were swapped in maybe_save_input_and_exit().

https://bugzilla.redhat.com/show_bug.cgi?id=1090773
2014-04-24 13:56:47 +02:00
Thomas Haller
785c2a8c95 all/test: modify makefiles to run tests (without arguments) via autoconf TESTS=
This results in some nice coloring. Only move the tests that are called
without arguments from check-local to TESTS.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-23 21:28:55 +02:00
Thomas Haller
adb75b0fa6 ifnet/test: fix test breakage after refactoring tests
Remove fake platform.

This regression was introduced by commit 0140cdb73d).

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-23 20:05:42 +02:00
Dan Winship
8f4e39cdc4 all: clean up "make check" results (bgo #727764) 2014-04-23 10:29:34 -04:00
Dan Winship
0140cdb73d core: use g_test_expect_message() in test programs
Use g_test_expect_message() in the various daemon-side test programs,
to avoid spewing error messages when (successfully) running "make
check".

The ifnet and ifupdown plugins are extremely verbose, so they were
partially "fixed" by turning down the logging level from INFO to WARN
in those tests.

test-dhcp-options needed to be converted to gtestutils so that the
newly-added check in nm-dbus-manager would recognize it as a test
program and not try to create a private bus.
2014-04-23 10:29:20 -04:00
Dan Winship
e3fc25731e dbus-manager: don't try to create private bus in test programs
When running test programs, don't try to create a private bus, since
it will fail if the user isn't root or if NetworkManager is currently
running, and it isn't what we want anyway.
2014-04-23 10:19:17 -04:00
Dan Winship
8537db959c settings: use nm_log_info/warning() in settings plugins
Remove the PLUGIN_PRINT() and PLUGIN_WARN() macros and use the
standard NM logging functions instead.

Also changed PLUGIN_PRINT("error: ...") to nm_log_warn("...") in
places.
2014-04-23 10:19:17 -04:00
Dan Winship
a4b8645a60 logging: use GLib's logging functions if not using syslog
If nm_logging_syslog_openlog() isn't called (ie, in the test
programs), then route nm_log() messages to g_log() rather than just
using fprintf().
2014-04-23 10:19:17 -04:00
Dan Winship
4618a07304 libnm-util: use g_test_expect_message() in tests
Use g_test_expect_message(), to avoid spewing tons of error messages
when (successfully) running "make check".
2014-04-23 10:19:17 -04:00
Dan Winship
bea82ca98b all: set G_LOG_DOMAIN appropriately, for better g_log() messages 2014-04-23 10:19:17 -04:00
Jiří Klimeš
645f0204f9 nmcli: improve setting connection.secondaries property
- check if the values being set are existing connections
- also allow specifying connections by names, translating them transparently
   to UUIDs.
- nmcli-specific section for 'describe' command added

(We use a global nm_cli variable in nmc_property_connection_set_secondaries())
2014-04-22 12:40:40 +02:00
Thomas Haller
ab0c37d042 dispatcher/test: fix tests after adding PATH environment variable
These tests were broken by commit 45ed459ae3.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-22 12:24:25 +02:00
Thomas Haller
6fcbd20597 ifnet/test: fix test breakage after moving wifi-utils to platform
Need to initialize (fake) platform.

This regression was introduced by commit df435f4015.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-22 11:49:57 +02:00
Jiří Klimeš
0757e33e74 core: fix MTU handling while merging/subtracting IP configs (bgo #721420)
https://bugzilla.gnome.org/show_bug.cgi?id=721420
https://bugzilla.redhat.com/show_bug.cgi?id=1047083
2014-04-22 10:58:55 +02:00
Dan Winship
30a98f3149 dispatcher: multiple fixes
https://bugzilla.gnome.org/show_bug.cgi?id=727439
2014-04-18 11:33:53 -04:00
Dan Winship
bb1c46f66d man: updates to the dispatcher section
Mention that the dispatcher kills slow scripts
(https://bugzilla.redhat.com/show_bug.cgi?id=982734) and that it runs
all scripts that have been queued, even if later events make that
"wrong". (Mentioned in https://bugzilla.gnome.org/show_bug.cgi?id=721971,
although that bug proposes changing this behavior, not documenting it.)
2014-04-18 11:33:20 -04:00
Dan Winship
3b197de59f dispatcher: add better debugging
Add LOGD_DISPATCH, and if it's set to DEBUG, tell nm-dispatcher to log
additional information about each script it runs.
2014-04-18 11:33:15 -04:00
Dan Winship
45ed459ae3 dispatcher: Leave PATH set in the dispatcher script environment
https://bugzilla.gnome.org/show_bug.cgi?id=724657
2014-04-18 11:32:13 -04:00
Dan Winship
d53357f420 dispatcher: tell systemd to not kill dispatcher children
You're supposed to be able to use dispatcher scripts to spawn
long-running processes, but currently systemd will kill them when
nm-dispatcher exits. Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=725492
2014-04-18 11:32:12 -04:00
Dan Winship
731ca771f8 dispatcher: only dispatch one request at a time (rh #1061212)
The dispatcher only runs one script at a time for any given request,
but would dispatch multiple requests in parallel. So if a device was
brought up and then back down quickly, it could end up dispatching the
"down" scripts while the "up" scripts were still running. Or if two
devices came up at the same time, two instances of the same "up"
script might run at the same time, which could cause problems if they
both tried to modify the same file.

Fix this by only dispatching the scripts for a single request at a
time.
2014-04-18 11:32:09 -04:00
Dan Winship
d9334503d7 dispatcher: bump script timeout up to 20 seconds (rh #1048345)
The dispatcher would kill scripts after 3 seconds, but on
heavily-loaded machines, that was sometimes too short even for simple
scripts. Bump the timeout up to 20 seconds instead (and change the
10-second quit-on-idle timer to not run when a script is running).

Also change the D-Bus call timeout in the daemon to 30 seconds, so
that it only triggers if something goes really wrong and the action
timeout fails.
2014-04-18 11:29:14 -04:00
Dan Winship
1796aae751 ifcfg-rh: don't write out IP config on Team connections 2014-04-17 13:00:41 -04:00
Dan Winship
6b2579fcdf keyfile: don't g_return_if_fail() on bad user input
return-if-fail is only for programmer errors
2014-04-17 13:00:37 -04:00
Dan Winship
8d9ddbee17 core: don't break Wake-on-LAN
https://bugzilla.gnome.org/show_bug.cgi?id=712745
https://bugzilla.redhat.com/show_bug.cgi?id=826652
https://bugzilla.redhat.com/show_bug.cgi?id=1025009
2014-04-17 12:48:38 -04:00
Dan Winship
1218b7e0c7 core: leave wake-on-LAN devices up over suspend/resume
Taking down a wake-on-LAN device before suspending will effectively
disable wake-on-LAN. So don't do that.

Based on a patch from Stanislaw Gruszka.

https://bugzilla.gnome.org/show_bug.cgi?id=712745
https://bugzilla.redhat.com/show_bug.cgi?id=826652
https://bugzilla.redhat.com/show_bug.cgi?id=1025009
2014-04-17 12:48:20 -04:00
Dan Winship
ddb17bef81 platform: add link_get_wake_on_lan() 2014-04-17 12:48:20 -04:00
Stanislaw Gruszka
79675fc1c9 wifi: add wifi_utils_get_wowlan() 2014-04-17 12:48:20 -04:00
Dan Winship
2b9b26d19b wifi: move wifi-utils into platform
https://bugzilla.gnome.org/show_bug.cgi?id=724365
2014-04-17 12:47:12 -04:00
Dan Winship
df435f4015 wifi: move wifi-utils into platform
Move wifi-utils into NMPlatform, and update callers to use the new
NMPlatform wrappers
2014-04-17 12:45:32 -04:00
Dan Winship
090a52217c wifi: (trivial) style / indent / whitespace fixes 2014-04-17 12:45:32 -04:00
Thomas Haller
ef770ca450 core: refactor NMManager by adding function for converting NMState to string
This will be especially nice, with lazy evaluation for NM logging.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-15 18:12:14 +02:00
Jiří Klimeš
b911d663d8 cli/bash-completion: escape spaces in profile names (rh #1041901) (bgo #709426)
We need to escape spaces and quotes in connection names, so that a connection
name containing spaces (quotes) is regarded as a single argument by bash.
See e.g. http://stackoverflow.com/questions/1146098/properly-handling-spaces-and-quotes-in-bash-completion

https://bugzilla.redhat.com/show_bug.cgi?id=1041901
https://bugzilla.gnome.org/show_bug.cgi?id=709426
2014-04-15 16:32:02 +02:00