Commit graph

14721 commits

Author SHA1 Message Date
Piotr Drąg
488cb6586b po: update Polish (pl) translation (bgo #764955)
https://bugzilla.gnome.org/show_bug.cgi?id=764955
(cherry picked from commit ed9a25773a)
2016-04-13 00:52:13 +02:00
Thomas Haller
2c4ab848ba po: translation fixes (bgo#764956)
https://bugzilla.gnome.org/show_bug.cgi?id=764956

(cherry picked from commit d6915100a5)
2016-04-12 18:49:02 +02:00
Piotr Drąg
5b7d954dbf po: fix syntax error in Telugu (te) translation
(cherry picked from commit 2cec85ed92)
2016-04-12 18:47:47 +02:00
Piotr Drąg
180754feb2 po: fix syntax error in French (fr) translation
(cherry picked from commit 4eedbb067a)
2016-04-12 18:47:45 +02:00
Lubomir Rintel
fe42e952e0 docs: don't set the online-location attribute
It causes the links to be based on a latest online version rather than
on the current one.

(cherry picked from commit 3be4c94446)
2016-04-12 16:22:16 +02:00
Lubomir Rintel
304f676e6e release: bump version to 1.1.94 (1.2-rc2) 2016-04-12 11:58:08 +02:00
Lubomir Rintel
84d2775c92 man: clarify the license of the manuals
It's included from GFDL 1.1+ document; it should be GFDL too.

(cherry picked from commit b349603959)
2016-04-12 11:23:48 +02:00
Lubomir Rintel
e2b36ab8fc man: don't template NetworkManager.conf.xml
Use XML entities instead.

(cherry picked from commit 530af7009e)
2016-04-12 11:23:48 +02:00
Lubomir Rintel
9ef6958109 man: remove work-in-progress warning
(cherry picked from commit 22fb039435)
2016-04-12 11:23:48 +02:00
Lubomir Rintel
af35a577bd man: fix prompt and user input formatting
(cherry picked from commit f73649db5c)
2016-04-12 11:23:48 +02:00
Lubomir Rintel
df1057f418 man: fix nmcli-examples synopsis formatting
(cherry picked from commit 37271b6827)
2016-04-12 11:23:48 +02:00
Lubomir Rintel
b13b1d2aac docs: toplevel document nitpicks
(cherry picked from commit 2a28bb4d04)
2016-04-12 11:23:47 +02:00
Thomas Haller
013ac9dfb2 libnm-core,core: merge branch 'th/nm-ip-address-zero-prefix'
(cherry picked from commit defc7fc89a)
2016-04-12 11:16:37 +02:00
Thomas Haller
b78e4de648 ifcfg-rh: support zero prefix length for IP addresses in reader
(cherry picked from commit a170320c35)
2016-04-12 11:16:12 +02:00
Thomas Haller
7b280fa162 core: expose NMIPAddress instances with prefix zero on D-Bus
Since commit 44768f0311, we skip
exposing NMIPAddress instances with prefix zero. Now, that is
supported and we can remove the check.

(cherry picked from commit 420bd611fd)
2016-04-12 11:16:12 +02:00
Thomas Haller
54df309a9f libnm-core: drup unused @allow_zero_prefix argument from valid_prefix()
(cherry picked from commit 6b8729a599)
2016-04-12 11:16:12 +02:00
Thomas Haller
b1f58fcd95 libnm-core: allow zero prefix length in NMIPAddress
Adding addresses with a prefix of zero is valid. Don't
reject them.

Note that this is an actual bug. If you configure an
address with prefix length zero, nmcli will report:

  $nmcli connection
  (process:1040): libnm-WARNING **: Ignoring invalid IP4 address: Invalid IPv4 address prefix '0'

(cherry picked from commit 57860c329e)
2016-04-12 11:16:12 +02:00
Thomas Haller
dd750e44a1 libnm-core/trivial: add code comment
(cherry picked from commit d68ccb84f1)
2016-04-12 11:16:12 +02:00
Thomas Haller
b973efdfa5 platform: merge branch 'th/platform-route-resync'
Lots of cleanup and refactoring. Most notably, make the
prefix-length property guint8.

Also fix keeping the route cache in sync when "modifying"
an existing route via `ip route change` or `ip route replace`.

(cherry picked from commit 514245b1d7)
2016-04-12 11:15:27 +02:00
Thomas Haller
0a97605d2e platform: set NLM_F_EXCL when adding links
When adding a link, set both NLM_F_CREATE and NLM_F_EXCL
flags.

`ip route add` and systemd-networkd sets NLM_F_EXCL too.

(cherry picked from commit 4bb76fb4c3)
2016-04-12 11:14:02 +02:00
Thomas Haller
ec35bb8236 platform: ensure cache consistency for routes by workaround missing kernel event
Consider:

  unshare -n
  ip link add d0 type dummy
  ip link add d1 type dummy
  ip link set d0 up
  ip link set d1 up
  ip addr add 192.168.100.5/24 dev d0
  ip addr add 192.168.101.5/24 dev d1

  ip route add 192.168.200.0/24 via 192.168.100.1
  ip monitor &
  ip route change 192.168.200.0/24 via 192.168.101.1
  #prints 192.168.200.0/24 via 192.168.101.1 dev d1
  ip route show
  #192.168.100.0/24 dev d0  proto kernel  scope link  src 192.168.100.5
  #192.168.101.0/24 dev d1  proto kernel  scope link  src 192.168.101.5
  #192.168.200.0/24 via 192.168.101.1 dev d1

Note that `ip route change` replaced the exising route. "Replaced" in this
case means: the previous route on device "d0" got removed and a new route
on "d1" was added. However, kernel only sent one RTM_NEWROUTE event, no
RTM_DELROUTE that notifies about this change.

We need to workaround that by re-synching the routes when we receive a
RTM_NEWROUTE notification.

(cherry picked from commit f8b2cadfc1)
2016-04-12 11:14:02 +02:00
Thomas Haller
bb654d8c25 platform: use _NM_UTILS_LOOKUP_DEFINE()
(cherry picked from commit 20618901dd)
2016-04-12 11:14:02 +02:00
Thomas Haller
6beb383bd7 platform: track refresh-all actions that are in progress
We aim to keep the platform cache up-to-date only via the netlink
events. However, due to kernel shortcomings we often have to resync
by re-requesting the data, which especially for routes and addresses
means a full dump (as you cannot request only specific route/address
information).

Thus it makes sense to avoid expensive dumps whenever we can.

We schedule dumps via "delayed-actions" and that is already smart
so that muliple schedulings are combined. However, before requesting
a new dump, we clear the flag that indicates that a dump is scheduled.
Thus, while processing the result of of a dump, we would re-schedule
anew which can be necessary in some cases.

In certain cases, we don't require a full resync, when we are in the
middle of processing a dump, because that one dump will provide us
with the full picture. Thus, we can avoid scheduling a new dump if
  - we already scheduled a delayed action
  - we are in the middle or processing a dump.
This can now be checked via delayed_action_refresh_all_in_progress().

(cherry picked from commit ff8c82e7e1)
2016-04-12 11:14:01 +02:00
Thomas Haller
d6478fa764 platform: refactor calling event_seq_check()
This makes more sense with the next commit.

(cherry picked from commit 8bf635af0e)
2016-04-12 11:14:01 +02:00
Thomas Haller
c0e0e5e92c platform: refactor delayed_action_wait_for_nl_response_complete()
(cherry picked from commit 90550a276b)
2016-04-12 11:14:01 +02:00
Thomas Haller
a20e11d268 platform: #ifdef out nlh_seq_last_handled if it's unused
This is not for performance. It's to separate the relavant
parts from a part that is only for logging/asserts.

(cherry picked from commit c59687c6b2)
2016-04-12 11:14:01 +02:00
Thomas Haller
53823384b5 platform: add macro FOR_EACH_DELAYED_ACTION()
(cherry picked from commit 15e357c30a)
2016-04-12 11:14:01 +02:00
Thomas Haller
c7f62fcd81 platform: expose nmp_utils_ip_config_source_to/from_rtprot()
Will be used also from the tests.

(cherry picked from commit 198baca830)
2016-04-12 11:14:01 +02:00
Thomas Haller
86e4975c60 platform/tests: improve nmtstp_wait_for_signal() to return number of signals
Instead of returning only TRUE/FALSE, return the number of signals
that were received while waiting. This make the API cleared, because
previously I always had to check anew whether wait-for-signal returns
TRUE or FALSE on timeout.

Also, add nmtstp_assert_wait_for_signal() and nmtstp_assert_wait_for_signal_until()
macros.

(cherry picked from commit af55476bf1)
2016-04-12 11:14:01 +02:00
Thomas Haller
a79a94fcfd platform/tests: add @platform argument to nmtstp functions
This allows tests to use these functions on a different platform instance
then on the singleton. The change makes the argument list longer, which is
unfortunate. On the other hand, it makes those functions more useful
in general.

You can't have it all.

Also, they now follow the pattern of most functions in NM where the type
is a singleton: you always pass the singleton to the function, although
in the usual case there is only one singleton instance. This allows to
use the function also on the non-singleton instance.

(cherry picked from commit c4151ebb5b)
2016-04-12 11:14:01 +02:00
Thomas Haller
df74df710e platform/tests: change build order to first build test-common.c and platform core
(cherry picked from commit 468501d0b0)
2016-04-12 11:14:01 +02:00
Thomas Haller
bd76c1e2d0 platform/tests/trivial: rename ip4_route_exists() functions to have nmtstp prefix
(cherry picked from commit f8f8c516e0)
2016-04-12 11:14:01 +02:00
Thomas Haller
7d6b286e1f platform/tests/trivial: rename init_tests() and setup_tests() function
Make it clear that they are nmtstp functions, i.e. they are found
in the header "test-common.h".

(cherry picked from commit 25d826ec49)
2016-04-12 11:14:01 +02:00
Thomas Haller
a314272d46 platform/tests: cleanup includes
(cherry picked from commit 93c81a809d)
2016-04-12 11:14:01 +02:00
Thomas Haller
bbec8844e2 platform/tests/trivial: move code around
(cherry picked from commit 56753ee41f)
2016-04-12 11:14:01 +02:00
Thomas Haller
04890bc709 platform/tests: use nm_linux_platform_new()
(cherry picked from commit 35e7703bdc)
2016-04-12 11:14:01 +02:00
Thomas Haller
d306ac633a platform: add NM_PLATFORM_NETNS_SUPPORT_DEFAULT
(cherry picked from commit d6b3081f7b)
2016-04-12 11:14:01 +02:00
Thomas Haller
b5bd562614 platform: add nm_linux_platform_new() constructor
(cherry picked from commit 45a9a6b30b)
2016-04-12 11:14:01 +02:00
Thomas Haller
4873850fd4 platform: change @plen field of NMPlatformIPxAddress to type guint8
On netlink layer, this field is uint8_t/uchar.

A larger (signed) plen makes no sense. Adjust the signatures
to have only guint8.

(cherry picked from commit 44768f0311)
2016-04-12 11:14:01 +02:00
Thomas Haller
08cce6c0ef platform: change @plen field of NMPlatformIPxRoute to type guint8
On netlink layer, this field is uint8_t/uchar.

A larger (signed) plen makes no sense. Adjust the signatures
to have only guint8.

(cherry picked from commit 14ee5dd2f8)
2016-04-12 11:14:01 +02:00
Thomas Haller
395a09cfc7 nmp-object: refactor handling of NMPCacheId to consider only relevant part of union
NMPCacheId is a union with fields for all known NMPCacheIdTypes.
Up to now, we always cloned the entire union, computed the hash
over all (possibly unset) fields and used memcmp() unanimously.

That was ok, because NMPCacheId was 16 bytes in total and cache-id
types that consumed less bytes didn't have a large overhead.

Next, we will add a new cache id type which increases the size of
NMPCacheId to 24 bytes. So, while possibly only a fraction of the
instances is that large, they would all have to pay that price.

Change that to consider and clone only those parts of the id
that are actually used.

(cherry picked from commit b1e3deaf2f)
2016-04-12 11:14:01 +02:00
Thomas Haller
72f36d1b5a nmp-object: refactor initializing NMPCacheId
As we get more NMPCacheIdType values, it's better to have for
each type a pre-declared list of supported types, instead of
iterating over all types and letting _nmp_object_init_cache_id()
figure out that the cache-id-type is unsupported on that object.

(cherry picked from commit fe78ae0b6a)
2016-04-12 11:14:01 +02:00
Thomas Haller
98766a96f2 shared: add _nm_packed macro for __attribute__((packed))
(cherry picked from commit 9a1e0b97da)
2016-04-12 11:14:01 +02:00
Thomas Haller
a0b561eda3 ip6-config: use nm_utils_ip6_address_same_prefix().
Instead of same_prefix() in nm_ip6_config_destination_is_direct(),
use nm_utils_ip6_address_same_prefix().

(cherry picked from commit 966fcdba1b)
2016-04-12 11:14:01 +02:00
Thomas Haller
5217586085 core: add nm_utils_ip6_address_same_prefix() util
(cherry picked from commit db3175d9c0)
2016-04-12 11:14:01 +02:00
Thomas Haller
ba5d2103fe dnsmasq/tests: make use of nmtst util to initialize NMPlatformIP4Address
(cherry picked from commit a18fca36a5)
2016-04-12 11:14:01 +02:00
Thomas Haller
3e5a6893c8 ip-config/tests: refactor tests to use utilities from "nm-test-utils.h"
(cherry picked from commit b3daf156de)
2016-04-12 11:14:01 +02:00
Thomas Haller
71cd1935d9 nmtst: add nmtst_platform_ip4_address() util
(cherry picked from commit 2e6ec6d8ac)
2016-04-12 11:14:01 +02:00
Thomas Haller
6451e9ce73 nmtst: add nmtst_rand_buf() util
(cherry picked from commit 0e78ce5ed6)
2016-04-12 11:14:01 +02:00
Thomas Haller
e3276ba6fe core/utils: add NM_UTILS_LOOKUP_ITEM_IGNORE_OTHER() switch case
NM_UTILS_LOOKUP_DEFAULT_NM_ASSERT() is useful because unless
compiled with NM_MORE_ASSERTS, there is no assertion.
An assertion includes the function name, and can make the
function ineligible for inlining.

(cherry picked from commit fbfe2ef216)
2016-04-12 11:14:01 +02:00