Commit Graph

13873 Commits

Author SHA1 Message Date
Thomas Haller
d90525ebfc libnm/tests: use nmtstc_nm_client_new() 2015-12-26 16:43:49 +01:00
Thomas Haller
56880fbe69 libnm/tests: add nmtstc_nm_client_new() 2015-12-26 16:43:49 +01:00
Thomas Haller
bdfcf02da3 libnm/tests: add NMTSTC_SERVICE_INFO_SETUP() macro 2015-12-26 16:43:49 +01:00
Thomas Haller
f354d5f0fc nmtst: enable connection utility functions for libnm-glib/libnm-utils library 2015-12-25 20:36:43 +01:00
Thomas Haller
9a11577e63 nmtst: add nmtst_uuid_generate() 2015-12-25 20:36:43 +01:00
Thomas Haller
c2bafa6153 nmtst: add nmtst_find_all_indexes() 2015-12-25 20:36:43 +01:00
Thomas Haller
766f31507b nmtst: add nmtst_main_loop_run() 2015-12-25 20:36:43 +01:00
Thomas Haller
c7d4d67d53 include: remove trailing semicolon from _Pragma() call 2015-12-24 11:42:37 +01:00
Thomas Haller
db80ec05ab build: rename directory "include" to "shared"
Up to now, the "include" directory contained (only) header files that were
used project-wide by libs, core, clients, et al.

Since the directory now also contains a non-header file, the "include"
name is misleading. Instead of adding yet another directory that is
project-wide, with non-header-only content, rename the "include"
directory to "shared".
2015-12-24 11:42:37 +01:00
Thomas Haller
bc06dd9332 libnm/tests: rename test functions to follow common pattern
Like the test utility functions in nm-test-utils.h and
platform's common.h, rename the helper functions to have
a nmtst(c) prefix.
2015-12-24 11:42:37 +01:00
Thomas Haller
fa3093e167 libnm/tests: move common testing code to nm-test-libnm-utils
The unit tests for libnm and libnm-glib use a NetworkManager stub
service written in Python (test-networkmanager-service.py). As they
share the same server, it makes sense to also share the same utility
code to drive the stub.

Move the common code to include/.

Note that contrary to "nm-test-utils.h", "nm-test-libnm-utils.h" is not
a header-only file. Instead its implementation is in "nm-test-utils-impl.c".
The reason for that this split is, if we later have yet another non-header-only
test-utility, then all the implementations are in "nm-test-utils-impl.c", requiring
the tests to link only one object file.
2015-12-24 11:42:37 +01:00
Thomas Haller
70713ee197 libnm/tests: unify common test code for libnm and libnm-glib
Unify the common test code to drive the D-Bus stub service
test-networkmanager-service.py. They will be merged in the next
commit.
2015-12-24 11:42:36 +01:00
Thomas Haller
45951bca50 build: separate compilation macro for libnm-util and libnm-glib
Set different defines for building libnm and legacy libnm-glib.
2015-12-24 11:42:36 +01:00
Beniamino Galvani
2ef3c1047d man: fix typos 2015-12-24 09:48:20 +01:00
Lubomir Rintel
dff1829c99 po: fix some typos in Galician translation 2015-12-23 14:40:47 +01:00
Lubomir Rintel
aa10b4233f po: update Brazilian Portuguese translation
https://bugzilla.gnome.org/show_bug.cgi?id=759747
2015-12-23 14:38:54 +01:00
Lubomir Rintel
6e98dab526 po: merge in nm-1-0 translations 2015-12-23 14:38:54 +01:00
Lubomir Rintel
7015932e90 po: update-po 2015-12-23 14:38:53 +01:00
Yuri Chornoivan
37cc168a5b po: update Ukrainian translation
https://bugzilla.gnome.org/show_bug.cgi?id=759659
2015-12-23 14:38:40 +01:00
Lubomir Rintel
93f1a1d461 platform: fix 32-bit build
Fixes: 6d67e6e9c4
2015-12-23 12:35:15 +01:00
Beniamino Galvani
e1d06d7a0b device/vlan: fix failed assertion in parent_hwaddr_changed()
Parent MAC can be NULL if the interface has gone, fix the following
failed assertion:

  [devices/nm-device-vlan.c:107] parent_hwaddr_changed(): (vlan1): parent hardware address changed
  nm_device_set_hw_addr: assertion 'addr != NULL' failed

While at it, improve logging by printing the new MAC address.

Fixes: e6d7fee5a6
2015-12-22 10:51:26 +01:00
Beniamino Galvani
9dffc0228b merge: support for changing MTU of software devices (bgo #759549)
https://bugzilla.gnome.org/show_bug.cgi?id=759549
2015-12-19 12:21:06 +01:00
Beniamino Galvani
29b93602fc tun: add support for MTU and cloned-mac-address properties
Make it possible to change ethernet.mtu and
ethernet.cloned-mac-address properties of tun/tap devices
(cloned-mac-address is meaningful only for taps).
2015-12-19 12:06:33 +01:00
Beniamino Galvani
9c837e95a3 vxlan: add support for MTU and cloned-mac-address properties
Make it possible to change ethernet.mtu and
ethernet.cloned-mac-address properties of vxlan devices.
2015-12-19 12:06:33 +01:00
Beniamino Galvani
1ff712d5d0 ip-tunnel: add a MTU property
Add a new ip-tunnel.mtu property which can be used to change the MTU
of the tunnel interface.
2015-12-19 12:06:33 +01:00
Thomas Haller
8c27a370ff libnm-util: allow unknown setting types in nm_connection_get_virtual_iface_name()
Allow calling nm_connection_get_virtual_iface_name() on a non-verified
connection by not asserting asserting against a valid base-setting.

On nma-1-0 branch, nm-applet can crash with:

    #3  0x00007ffff2993a7a in g_assertion_message_expr (domain=0x7ffff51fad86 "libnm-util", file=0x7ffff51fb728 "nm-connection.c", line=320, func=0x7ffff51fc028 "_get_type_setting", expr=<optimized out>) at gtestutils.c:2444
    #4  0x00007ffff51ac52f in _get_type_setting (connection=0xa3c160 [NMRemoteConnection]) at nm-connection.c:320
    #5  0x00007ffff51ac341 in nm_connection_get_virtual_iface_name (connection=0xa3c160 [NMRemoteConnection]) at nm-connection.c:1436
    #6  0x0000000000415bdc in add_virtual_items (type=type@entry=0x43c11d "bridge", all_devices=all_devices@entry=0x7f6580, all_connections=all_connections@entry=0x9354a0, menu=menu@entry=0x922990 [GtkMenu], applet=applet@entry=0x6cc000 [NMApplet]) at applet.c:1640
    #7  0x00000000004176f6 in nma_menu_add_devices (menu=menu@entry=0x922990 [GtkMenu], applet=applet@entry=0x6cc000 [NMApplet]) at applet.c:1713
    #8  0x0000000000418315 in nma_menu_show_cb (menu=0x922990 [GtkMenu], applet=0x6cc000 [NMApplet]) at applet.c:1974

where the connection type is "tun".

Note that libnm accepts invalid connections and exposes them to the
user (albeit issuing a warning). Later on there are many places where
that can lead to further g_return*(), which is ugly indeed.
At least, we should not assert against valid connections (because that
crashes the user) and there is a well known fact that the base setting
will be missing for tun settings. No need to even warn about that in
nm_connection_get_virtual_iface_name() (we already got the warning
during replace_settings).
2015-12-18 14:50:00 +01:00
Lubomir Rintel
d830841d63 manager: return values for a non-void function
Fixes: d8e1590c50
2015-12-18 12:10:02 +01:00
Lubomir Rintel
d8e1590c50 manager: retry device creation for connection that would use a newly created device
The VLANs (unrealized) can depend on the devices that are not around yet. We
need to retry their creation when the potential parents appear.
2015-12-18 11:32:34 +01:00
Jiří Klimeš
9ec9e4e72a libnm-core/docs: add/fix missing descriptions 2015-12-18 11:16:22 +01:00
Jiří Klimeš
360d5037a4 docs: add missing documentation for settings and devices 2015-12-18 11:05:39 +01:00
Jiří Klimeš
3ca758790e libnm: fix documentation of NMSettingIP6ConfigAddrGenMode values 2015-12-18 10:27:27 +01:00
Thomas Haller
793e985918 rdisc: fix regression in send_rs() (cannot create router solicitation)
Fixes: 21efcfe6b5
2015-12-17 21:26:54 +01:00
Thomas Haller
5aba5685f2 platform: merge branch 'th/platform-no-sync-socket-bgo759490'
https://bugzilla.gnome.org/show_bug.cgi?id=759490
2015-12-17 18:44:43 +01:00
Thomas Haller
c40acf334e core: optimize NMMultiIndex by special caseing ids with one value only
When adding a very first item for a certain id, don't yet create a
hash table but store the first item inplace. This optimizes storage
for the case where we have only one item for a certain id.
2015-12-17 18:42:54 +01:00
Thomas Haller
ad1d74d142 platform: add index for links by ifname
Downsides:

  - Add some additional overhead to manage the index

  - The NMPCacheId struct grows to 16 bytes, affecting
    hashing performance for all object types.

Still do it, based on the assumption that it doesn't matter
for a low number of interfaces. But the O(1) access time matters
when having lots of interfaces.
2015-12-17 18:42:53 +01:00
Thomas Haller
88213b2e6a platform: tighten return value from do_add_addrroute()
Only return TRUE, if the netlink request was responded with success and
the object exists after adding.
2015-12-17 18:42:53 +01:00
Thomas Haller
1a501c6456 platform: check for existing link in do_add_link_with_lookup()
When adding a link, that can only make sense if no such link
exists yet. Check for that condition first, to properly return
an error.
2015-12-17 18:42:53 +01:00
Thomas Haller
cea8f1a0f0 platform: change meaning of return value for delete-function
When deleting an object, we allow failure to delete a non-existing object.
Thus, the only thing we care about is whether the object is no longer
present after deletion. Adjust the return values to reflect that.
2015-12-17 18:42:53 +01:00
Thomas Haller
690732cfed platform: drop delayed_action idle handler
The idea was allowing pending delayed-actions and process them in an
idle handler. We dont want to do that, because whenever platform code
returns, we want to have no pending actions -- because otherwise the
platform cache might be in an inconsistent state.

Just drop it.
2015-12-17 18:42:51 +01:00
Thomas Haller
a29f438294 platform/trivial: rename internal field with netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
412a50bd30 platform: inline event_handler_read_netlink() 2015-12-17 18:42:01 +01:00
Thomas Haller
d7782b9769 platform: drop synchronous netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
c73b9f6529 platform: change links via event netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
1097967077 platform: delete objects via event netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
be28608a8f platform: add addresses and routes via event netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
f8378800bb platform: add links via event netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
dce5e6d815 platform: assert that delayed_action_handle_all() is not called recursively
We would not expect that delayed_action_handle_all() is called recursively.
Assert against that. If we ever happen to call it recursively, we would
need to take care of properly avoiding infinite loops or deep call
stacks.
2015-12-17 18:41:59 +01:00
Thomas Haller
6d67e6e9c4 platform: rework waiting for netlink response
Track pending netlink requests and properly report the resulting errno
back.

Currently we send only requests in do_request_link() and do_request_all().
These callers don't actually care about the result, all they care that the
request is answered before returning back from platform code to the caller.
Thus, up to now the tracking of the sequence number was pretty simple.

Later we also want to get the errno from a request, thus rework sending
requests to also remember about outstanding sequence numbers and
properly track muliple parallel requests.

Later the synchronous actions (e.g. add-link) will also be handled
via the asynchronous socket.
2015-12-17 18:32:15 +01:00
Thomas Haller
eb182c2e1c platform: minor refactoring in delayed_action_schedule() 2015-12-17 18:32:09 +01:00
Thomas Haller
c9e04c963e platform: implement our own sequence counter
Instead of using the one from libnl's socket.
2015-12-17 18:32:06 +01:00