Commit graph

7427 commits

Author SHA1 Message Date
Colin Walters
21ba714f78 keyfile: Use "goto out" style error handling
Just code cleanup: This is much less error-prone than manual nesting,
and will mesh very well with future changes to use the libgsystem
cleanup macros.
2013-03-07 15:46:15 -06:00
Dan Winship
6f44b7f3c6 all: remove redundant return-if-fail checks
NM_IS_FOO(x) returns FALSE if x is NULL, so we don't need a separate
(x != NULL) check before it.
2013-03-07 07:32:27 -05:00
Dan Winship
0006c6aa1d trivial: update .gitignore 2013-03-07 07:12:53 -05:00
Pavel Šimerda
bf32605287 cleanup: remove unnecessary headers from nm-netlink-monitor.h
Accomodate nm-netlink-monitor.c to the change by moving around utility
functions and making them static (removing if not used). Unsubscription
of rtnl groups is not necessary and the whole process will be eventually
moved to nm-platform.
2013-03-06 11:59:07 +01:00
Pavel Šimerda
8f758b0af9 cleanup: remove nm-netlink-compat 2013-03-05 23:02:50 +01:00
Pavel Šimerda
47a3e24d32 netlink: replace libnl 1.x functions
Confusingly, nm-platform-compat's rtnl_link_set_oif adds a new nexthop
with ifindex set, while rtnl_link_set_gateway sets gateway for an
existing nexthop. Keeping the behavior to avoid potential problems.
2013-03-05 23:02:42 +01:00
Pavel Šimerda
92481c6a6a ip6: replace libnl 1.x functions 2013-03-05 20:22:47 +01:00
Pavel Šimerda
487afb779c ip6: use delayed execution to avoid duplicate events
device_sync_from_netlink() and nm_netlink_request_ip6_info() are now
delayed, so that they are called only once for a series of events. This
makes the IPv6 processing and especially debug messages more sane.
2013-03-05 02:34:21 +01:00
Pavel Šimerda
896af74097 ip6: replace timed polling with event-based call
Request IPv6 flags from kernel on RTM_NEWROUTE/RTM_DELROUTE instead
of requesting periodically.
2013-03-05 02:32:42 +01:00
Pavel Šimerda
a93fb28d1a ip6: don't subscribe for RTM_PREFIX messages 2013-03-05 02:29:50 +01:00
Pavel Šimerda
195a09d7c0 ip6: fix rtnl_route_alloc_cache() call
NL_AUTO_PROVIDE is not a valid flag for this call and it's coincidental
with ROUTE_CACHE_CONTENT, which is certainly not what we want.

NETLINK_ROUTE is a netlink family, not an address family. It is
coincidental with AF_UNSPEC which is what we actually want.
2013-03-05 02:29:43 +01:00
Pavel Šimerda
fc41ae3ac6 ip6: use assert for fatal errors during initialization 2013-03-05 01:49:18 +01:00
Pavel Šimerda
54746d5ed4 ip6: clean up and improve debugging
Stop logging the whole list of addresses as we already have new and lost
addresses logged. Stop putting 'state' and 'ra_flags' in almost every
message since changes of those are already logged. Log target state
change.
2013-03-05 01:49:13 +01:00
Pavel Šimerda
9dddb51af2 ip6: rename got-ra to got-router-advertisement 2013-03-05 01:02:37 +01:00
Pavel Šimerda
649c21bbc9 trivial: add missing standard includes
This will help later cleanups of nm-system.
2013-03-04 22:11:54 +01:00
Pavel Šimerda
bb8c75bd53 remove obsolete nm-tool
Use nmcli instead.
2013-03-04 22:11:45 +01:00
Dan Williams
632c52ceea libnm-glib: fix type annotation of NMDHCP[46]Config:options
The GOI syntax changed a while back and these didn't follow.
2013-02-27 18:09:52 +01:00
Dan Williams
395228b5cf Revert "libnm-glib: fix type annotation of NMDHCP[46]Config:options"
This reverts commit 0e0b5da7e3.

Syntax actually uses () instead of <> for various docbook-related
reasons.
2013-02-27 18:09:52 +01:00
Dan Williams
a096ef8f87 core: fix more GValueArray deprecation fallout 2013-02-27 18:09:52 +01:00
Dan Williams
97990135f1 dhcp: ensure any dhclient script from dhclient.conf is ignored
The config file can specify a dhclient script, which gets used instead
of what NM passes on the command-line.  Make sure that script gets
ignored in the final dhclient config, because the script NM passes
is the script that needs to be used to pass data back to NM.  People
may have old dhclient.conf files lying around that get picked up and
we don't want any script specified there to interfere.
2013-02-27 17:17:11 +01:00
Dan Williams
80886c2866 libnm-glib: work around possible compiler bug with GValueArray deprecation workarounds
GValueArray is deprecated.  Unfortunately, it's part of our API right now,
so we have to keep it around for a while.  But since it's deprecated, and
we want to know about *other* deprecations, we have to suppress deprecations
about GValueArray.  Unfortunately using macros to do that (eg in
nm-gvaluearray-compat.h) exposes some compiler bugs due to the combination
of parentheses/braces and #pragma from G_GNUC_BEGIN_IGNORE_DEPRECATIONS,
resulting in warnings like:

nm-utils.c:920:9: error: expected expression before ‘#pragma’

Work around this by not trying to stuff what's now a macro (eg
g_value_array_get_nth) into what's already a macro (G_VALUE_TYPE).
There's probably a better way to do this...
2013-02-27 17:16:27 +01:00
Dan Williams
db7ba1c161 trivial: rename 'link' to avoid shadowing a global variable/function
nm-system.c: In function "nm_system_bond_enslave":
nm-system.c:1689:21: error: declaration of "link" shadows a global declaration [-Werror=shadow]
2013-02-27 15:41:07 +01:00
Dan Winship
0e0b5da7e3 libnm-glib: fix type annotation of NMDHCP[46]Config:options 2013-02-26 13:26:38 +01:00
Dan Winship
de2e32b375 build: Update GLIB_VERSION_MIN_REQUIRED to 2.32
now that it no longer causes any warnings
2013-02-26 13:07:33 +01:00
Dan Winship
be89197214 core: remove remaining pre-2.32 GLib compat / deprecated usage 2013-02-26 13:07:33 +01:00
Dan Winship
a2cdf63204 core: use GResolver for reverse resolution
Remove the HostnameThread stuff from nm-policy-hostname and just use
GResolver instead. Move the one remaining nm-policy-hostname function
into nm-policy.
2013-02-26 13:07:33 +01:00
Dan Winship
f936400c38 tests: clean up gtester usage
Use g_test_add_func() and g_test_add_data_func() to simplify the test
cases, getting rid of the GLIB_CHECK_VERSION calls in the process.
2013-02-26 13:07:33 +01:00
Dan Winship
ed9e2d8377 build: avoid GValueArray deprecation warnings
Avoid warnings about GValueArray being deprecated by adding macros
that wrap G_GNUC_BEGIN_IGNORE_DEPRECATIONS /
G_GNUC_END_IGNORE_DEPRECATIONS around the GValueArray calls.
2013-02-26 13:07:33 +01:00
Dan Winship
3bd867bb62 build: remove glib-mkenums
This was imported to get a bugfix in glib 2.31.5; since we require
2.32 now, we can use the system glib-mkenums.
2013-02-26 13:07:32 +01:00
Dan Winship
279a347abf examples: remove GLIB_CHECK_VERSION checks from GDBus examples 2013-02-26 13:07:32 +01:00
Dan Winship
38035856d9 build: require GLib 2.32 2013-02-26 13:07:32 +01:00
Jiří Klimeš
5e17df86f4 cli: fix a crash in 'nmcli d l' when no connections available for a device
The regression caused by 1dca1e3c3d
2013-02-26 11:44:22 +01:00
Dan Williams
47d8db57b5 trivial: plug some memory leaks
(review+ danw)
2013-02-25 16:07:03 +01:00
Dan Williams
5f626b1c56 trivial: fix makefile typo 2013-02-22 08:57:56 -06:00
Dan Williams
a2269b0974 libnm-glib: bump soname for added functions 2013-02-22 08:34:25 -06:00
Dan Williams
3e689be15e libnm-util: bump soname for added functions 2013-02-22 08:34:19 -06:00
Dan Williams
4f9e13fcb0 libnm-glib: add Since tags to new functions and properties 2013-02-22 08:34:13 -06:00
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