Commit Graph

10267 Commits

Author SHA1 Message Date
Dan Winship
741ee7d051 Miscellaneous libnm-util/libnm-glib/include cleanups
https://bugzilla.gnome.org/show_bug.cgi?id=732867
2014-07-15 10:17:49 -04:00
Dan Winship
6e51e460df libnm-util: NetworkManager.h/NetworkManagerVPN.h doc fixups
Add gtk-docs for enum types that previously didn't have them.

Explicitly note the relationship between NetworkManager.h /
NetworkManagerVPN.h types and the corresponding introspection/*.xml
types.
2014-07-15 09:44:55 -04:00
Dan Winship
e42ab85f1b introspection: fix VPN.Plugin State type
It was listed as being tp:type="NM_VPN_CONNECTION_STATE", but it's
actually NM_VPN_SERVICE_STATE (which wasn't previously documented).
2014-07-15 09:44:55 -04:00
Dan Winship
3aad3124f1 libnm-glib: drop separate test library
Previously, we built a second copy of libnm-glib that was hacked to
use the session bus rather than the system bus, for use by the test
programs. Rather than doing that, just have test-nm-client explicitly
override the choice of bus. (test-remote-settings-client was actually
already doing this, although it leaked the bus after.)
2014-07-15 09:44:55 -04:00
Dan Winship
2570c5a17c libnm-util, libnm-glib: whitespace fixes
Fix indentation, kill trailing whitespace, split some long lines.
2014-07-15 09:44:55 -04:00
Dan Winship
cb7e1893e7 libnm-util, libnm-glib: standardize copyright/license headers
- Remove list of authors from files that had them; these serve no
  purpose except to quickly get out of date (and were only used in
  libnm-util and not libnm-glib anyway).

- Just say "Copyright", not "(C) Copyright" or "Copyright (C)"

- Put copyright statement after the license, not before

- Remove "NetworkManager - Network link manager" from the few files
  that contained it, and "libnm_glib -- Access network status &
  information from glib applications" from the many files that
  contained it.

- Remove vim modeline from nm-device-olpc-mesh.[ch], add emacs modeline
  to files that were missing it.
2014-07-15 09:44:54 -04:00
Dan Winship
4223fa47e4 libnm-util, libnm-glib: tweak (element-type) annotations in docs
g-i allows you to specify types in annotations using either their
fully-qualified introspected names (eg, "NMClient.Device") or their
plain C names ("NMDevice"). Switch from the former to the latter (so
that they'll still be correct when migrated to libnm later).
2014-07-15 09:44:54 -04:00
Dan Winship
7eb0288aa0 libnm-util: move NetworkManager.h, etc, from include/ to here
NetworkManager.h, NetworkManagerVPN.h, and nm-version.h are part of
the libnm-util API, so move them to libnm-util.

include/ still contains headers that are strictly NM-internal (eg,
nm-glib-compat.h).
2014-07-15 09:44:54 -04:00
Thomas Haller
f352bfd2af trivial/libnm-glib: rename internal PROP_* enum values
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-14 19:31:34 +02:00
Jiří Klimeš
0105fb884a core: use nm_utils_is_specific_hostname() instead of hardcoded "localhost" 2014-07-14 17:36:07 +02:00
Jiří Klimeš
bf1231d02a policy: don't use default hostname as configured hostname (rh #1110436)
Even if administrator-configured hostname (/etc/hostname) takes precedence
over other hostname configurations, we don't take "localhost", "localhost6",
"localhost.localdomain", "localhost6.localdomain6" as such. These values might
be set by some tools (like installer). But that's not right and we compensate
for that. It doesn't make much sense that an admimistrator would set these
values manually (intentionally), because leaving /etc/hostname empty will
result in "localhost" hostname anyway (set by systemd).

https://bugzilla.redhat.com/show_bug.cgi?id=1110436
2014-07-14 17:36:07 +02:00
Jiří Klimeš
70e930bc0e utils: add nm_utils_is_specific_hostname()
The function detects whether the hostname is a specific hostname diferrent
from default hostnames like localhost, localhost[6].localdomain[6].
2014-07-14 17:36:07 +02:00
Thomas Haller
568742ed41 libnm-glib: fix initialization of NMObject type
Ensure that the @type_funcs and @type_async_funcs
hashes are initialized before running the class
init function.

libnm-glib-scan hits the following assertion:
  GLib-CRITICAL **: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
  #0  0x0000003370c504e9 in g_logv (log_domain=0x3370cb2f4e "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffd1578f70) at gmessages.c:989
  #1  0x0000003370c5063f in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at gmessages.c:1025
  #2  0x00007f2169f42545 in _nm_object_register_type_func (base_type=base_type@entry=13597296, type_func=type_func@entry=0x7f2169f47ae9 <_nm_device_type_for_path>, type_async_func=type_async_func@entry=
      0x7f2169f47880 <_nm_device_type_for_path_async>) at nm-object.c:551
  #3  0x00007f2169f48664 in nm_device_get_type () at nm-device.c:62
  #4  0x0000000000402577 in get_object_types () at libnm-glib-scan.c:46
  #5  0x0000000000404b0b in main (argc=<optimized out>, argv=<optimized out>) at libnm-glib-scan.c:135

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-14 16:14:03 +02:00
Dan Williams
66d1f2f53c platform: ignore RTM_F_CLONED (eg, cache) routes
The kernel adds these for various operations; they are short-lived,
added often, and not useful to NetworkManager.  Ignore them.  This
prevents NetworkManager from continuously updating the IPv6 config
and emitting state changes to clients via D-Bus for useless changes.
2014-07-11 14:51:12 -05:00
Dan Winship
09da178639 libnm-util: fix build with --with-crypto=gnutls
The non-"_t"-suffixed type names in gnutls have been deprecated since
1.x, and in recent versions will trigger deprecation warnings. Fix by
using "gnutls_datum_t" instead of "gnutls_datum".
2014-07-11 12:09:39 -04:00
Thomas Haller
98bc1c8cf9 config: replace g_warning() by nm_log_warn()
Quite possibly these logging lines hit before we setup nm-logging
initially and before NM main() calls nm_logging_syslog_openlog().
This is because NM first needs to read the configuration, before setting
up logging.

Note however, that nm-logging is robust against both.

If nm_logging_setup() was not yet called, it will automatically setup
"DEFAULT","INFO".

If nm_logging_syslog_openlog() was not yet called, it will redirect
logging to g_log() -- which basically ends up at g_warning() again.

Still this is useful in case when hitting those lines *afterwards*.
Especially, later when we support reloading of configuration.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-11 13:13:15 +02:00
Thomas Haller
a218199eb6 config: fix leaked GError when no default config file exists
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-11 13:13:15 +02:00
Thomas Haller
397762c2c7 merge branch 'th/kill_child'
https://bugzilla.gnome.org/show_bug.cgi?id=725660

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-10 16:33:45 +02:00
Thomas Haller
ff3b753857 core: use nm_utils_kill_child_async() and nm_utils_kill_child_sync()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-10 16:25:10 +02:00
Thomas Haller
1f8418541e core: add nm_utils_kill_child_async() and nm_utils_kill_child_sync() function
Add utility function to kill and reap a child process.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-10 16:25:10 +02:00
Thomas Haller
c469e81f96 core/test: move src/tests/test-general over to nm-test-utils.h (nmtst)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-10 13:27:12 +02:00
Thomas Haller
362c4fe188 nmtst: ensure call to nm_utils_get_monotonic_timestamp_s() in nmtst_init()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-10 13:27:12 +02:00
Thomas Haller
734203e12e libnm-glib/tests: remove waiting time for initializing NMClient
This waiting time significantly increases the runtime of the tests.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-08 19:01:01 +02:00
Thomas Haller
97c7cc8b94 build: unset G_DEBUG variable before calling vapigen
Defining G_DEBUG=fatal-warnings is useful for debugging, but it causes
the build to fail due to asserts during vapigen.

Unset G_DEBUG before calling vapigen.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-08 16:26:14 +02:00
Dan Winship
da25a788fa trivial: add a missing word to documentation 2014-07-07 14:04:51 -04:00
Thomas Haller
40a3e20006 contrib/rpm: add --quick argument to build_clean.sh script
Before, build_clean.sh always required building all NetworkManager
and doing another `make distcheck` before calling rpmbuild.

That is still a good idea, to ensure that we get a proper build.
For some quick testing however, lets speed this up with a new
--dist argument that only calls `make dist`.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-04 19:59:08 +02:00
Thomas Haller
d2be2ac78d contrib/rpm: update spec file to make ppp_version dependent on fedora version
Fedora 21 (rawhide) needs ppp version 2.4.6.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-04 13:44:44 +02:00
Thomas Haller
63070fff02 build: call generate-setting-docs.py directly instead of through strace
This was added for debugging, but is no longer necessary.
Also, strace might not be installed on any system so don't depend on it.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-04 13:43:59 +02:00
Thomas Haller
3cfd8b8eec contrib/rpm: add new package NetworkManager-config-connectivity-fedora
Provides config file 20-connectivity-fedora.conf

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-04 12:25:51 +02:00
Dan Williams
8c113e4fc8 bluez: ignore child BNEP interfaces
The interface is owned by the parent NMDeviceBt and is not independently
usable.  If not ignored, NM tries to assume a connection on the bnep
interface and messes the Bluetooth connection up.
2014-07-03 18:50:57 -05:00
Dan Williams
275eea195d bluez: suppress warning when already disconnected 2014-07-03 18:50:50 -05:00
Dan Williams
a949c38d8e bluez: handle Bluez4 PropertyChanged events
The addition of Bluez5 support mistakenly broke support for Bluez4 property
change events.  Bluez4 uses a custom D-Bus interface that we must explicitly
handle.

This caused NM to ignore BT devices immediately after pairing, since the UUIDs
only show up through a custom Bluez4 PropertyChanged even when pairing is
complete.  Only then do we finally know priv->capabilities, and only then is
the NMBluezDevice usable.
2014-07-03 18:50:41 -05:00
Dan Williams
3ee9c3be57 ifcfg-rh: fix reading 802.1x phase2 EAP-GTC method 2014-07-03 14:05:04 -05:00
Thomas Haller
bbdae859f6 keyfile: avoid assertion reading keyfile without connection.type property
Avoids the following warning:
  (NetworkManager:26113): libnm-util-CRITICAL **: nm_connection_get_setting_by_name: assertion 'name != NULL' failed

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-03 14:00:37 +02:00
Dan Winship
ebeaeaed4d core: make veth devices default-unmanaged for now
We only want to treat a veth device as ethernet if (a) NM is running
inside a container, and (b) the veth in question is the "inside" end
of the veth, not the outside. Unfortunately, we don't have good
heuristics for this at the moment, so just ignore veths for now.

https://bugzilla.gnome.org/show_bug.cgi?id=731014
2014-07-02 14:58:53 -05:00
Dan Williams
6cb6d39725 libnm-util: merge nm-util-private and nm-utils-private
No reason to have two differently named files for the
same general purpose.
2014-07-02 13:33:58 -05:00
Thomas Haller
62dd70e1d1 core: use singleton nm_firewall_manager_get() throughout without taking additional ref
No need to keep references of the singleton and take an additional ref
when accessing nm_firewall_manager_get().
Especially, since the firewall manager instance was nowhere passed in from
externally, it doesn't even sense for some vague testing purporse. Not to
mention, that there are no tests that actually inject a firewall manager stub.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-02 15:27:32 +02:00
Thomas Haller
e343c45ebb supplicant: fix crash passing invalid parameter to AddBlob when adding network
The DBUS method 'AddBlob' expects a data argument of type 'ay'.
Instead we passed the hash table 'blobs'.

This must be broken for a long time and surprisingly stayed unnoticed.

https://mail.gnome.org/archives/networkmanager-list/2014-July/msg00001.html

Fixes: fb6cde508c
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-02 13:08:23 +02:00
Thomas Haller
0ce2d2618c core: remove unused @state variable from nm_device_activate_schedule_stage3_ip_config_start()
Fixes: 5affa446aa
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-02 13:08:23 +02:00
Dan Williams
ca2e2a7ec8 docs: ignore a private header 2014-07-01 15:47:59 -05:00
Dan Williams
2428401f5e docs: fix multi-line Since notation 2014-07-01 15:47:54 -05:00
Jiří Klimeš
4dcfdec347 device: test dhcp[46]_config when getting properties, not dhcp[46]_client
An assertion in nm_dhcp4_config_get_dbus_path() has been actually fixed
by 3d6936b2cc (hopefully for all cases).
But still I think we should check _config here instead of _client.
2014-07-01 12:56:52 +02:00
Thomas Haller
392d4e4831 merge branch 'th/rh979425_set_virtual_iface_name'
https://bugzilla.redhat.com/show_bug.cgi?id=979425
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 18:43:37 +02:00
Thomas Haller
f600f31289 core: remove nm_utils_normalize_connection function
This functionality is now provided by nm_connection_normalize().

Contrary to nm_utils_normalize_connection(), nm_connection_normalize()
is in libnm-util and available to clients as well.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 18:35:46 +02:00
Thomas Haller
29d538239f libnm-util: normalize IP settings in connection
This is the same behaviour as nm_utils_normalize_connection(),
which will soon be removed in favor of nm_connection_normalize().

This takes care, that normal connections always have an IP4 and IP6 setting,
and that slave connections never have it.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 18:35:46 +02:00
Thomas Haller
794ed1c9ef libnm-util: validate master/slave-type property in NMSettingConnection::verify()
- Before, when setting the slave-type to an invalid type, the setting
  was silently accepted. Now verification fails with "Unknown slave type '%s'"

- Before, the @master property was not checked. So you could have a @slave-type,
  without having @master set. And similarly, you could have @master, but
  no @slave-type. Fix both issues.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 18:35:46 +02:00
Thomas Haller
2deaa5397a libnm-util: normalize virtual_iface_name in NMSettings
Some type-specific NMSetting implementations (bond, bridge, team, vlan)
have their own 'interface-name' property. This property will be
deprecated in favour of 'interface-name' in NMSettingConnection.

Change verify() and normalize() to check that the redundant
values match and repair/normalize the properties.

Force the virtual interface name of the type-specific setting to be
equal to NMSettingConnection:interface_name. This way, the depreacted
field stays valid and backward compatible.

NMSettingInfiniband is special, because it does not have a backing
property for the interface name, although it implements
get_virtual_iface_name(). To account for this, some special handling
is needed in order not to change the behaviour of get_virtual_iface_name().

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 18:35:46 +02:00
Thomas Haller
de5656a570 libnm-util: add function nm_connection_normalize
This function behaves like verify(), but it also performs some
normalization/fixing of inconsistent connections.

Contrary to verify(), this function might modify the settings.
This will be mainly used, to repair connections from older versions
and to fix deprecated options.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 18:35:46 +02:00
Thomas Haller
542f1fe3c9 test: nm_connection_verify() sets the interface-name to virtual_iface_name.
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 18:35:16 +02:00
Thomas Haller
28169725d7 libnm-util: add function nm_connection_get_interface_name()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-30 18:35:16 +02:00