Commit Graph

15047 Commits

Author SHA1 Message Date
Thomas Haller
e1f1e07a3d lldp: implement properties via NM_GOBJECT_PROPERTIES_DEFINE() 2016-03-17 15:00:48 +01:00
Thomas Haller
c68dd4a202 lldp: improve logging 2016-03-17 15:00:48 +01:00
Thomas Haller
9c5265621c lldp: let lldp_neighbor_new() also create invalid objects
When we receive an update for a certain neighbor, the update
might be invalid and we want to reject it. However, we still
must create an invalid object to compare whether the update
causes a remove of a previously valid neighbor.

Let lldp_neighbor_new() create an instance as long as the
id fields are present.
2016-03-17 15:00:48 +01:00
Thomas Haller
1497b7eaf8 lldp: cache the GVariant in LldpNeighbor 2016-03-17 15:00:48 +01:00
Thomas Haller
2cf562f58e lldp: factor out lldp_neighbor_to_variant() 2016-03-17 15:00:48 +01:00
Thomas Haller
a16da9c6a8 lldp: refactor processing all lldp-neighbors
Instead of replacing the whole hash with a new one (and all new by a new one,
LldpNeighbor instances), update the existing hash.

One point of this is that our process-all function requires less
comparisons and avoids duplicate work right earlier. E.g. if a neighbor
didn't change, we don't have to put it into a hash to compare later for
equality.

But more importantly, we preserve our LldpNeighbor instance instead
of recreating them all the time. Later, the LldpNeighbor will cache
the GVariant.
2016-03-17 15:00:48 +01:00
Thomas Haller
e66c581c11 lldp: split out creation of LldpNeighbor instance 2016-03-17 15:00:48 +01:00
Thomas Haller
4797e9fcdb lldp/trivial: rename internal type LLDPNeighbor to LldpNeighbor
Our convention is to use camel case for abbreviations
that are longer then 2 charaters.
2016-03-17 15:00:48 +01:00
Thomas Haller
e94329f092 systemd: lldp: fix starting ttl timer for lldp neighbor
lldp_start_timer() was only called during sd_lldp_get_neighbors().
Ensure that the timer is (re-)started when a new neighbor appears.
Otherwise, the timer is not started when relying on the events alone.

https://github.com/systemd/systemd/pull/2826
2016-03-17 15:00:48 +01:00
Thomas Haller
c75c51d505 logging: add new logging domain "SYSTEMD" for internal systemd logging 2016-03-17 15:00:48 +01:00
Thomas Haller
0330a55851 shared: add nm_unauto() helper macro 2016-03-17 15:00:48 +01:00
Thomas Haller
a50d28d4dd shared: add nm_assert_not_reached() 2016-03-17 15:00:48 +01:00
Thomas Haller
ab2456493d utils/core: add NM_UTILS_NS_PER_MSEC macro 2016-03-17 15:00:48 +01:00
Thomas Haller
2778d257cc libnm: declare internal function as static 2016-03-17 11:32:53 +01:00
Beniamino Galvani
e2040e5ebe merge: branch 'bg/8021x-domain-suffix-match-bgo341323'
Add domain-suffix-match properties to NMSetting8021x.

https://bugzilla.gnome.org/show_bug.cgi?id=341323
2016-03-16 17:34:52 +01:00
Beniamino Galvani
46f8045c9e libnm-core: nm-setting-8021x: treat some empty properties as NULL
For some properties as *subject-match and *domain-suffix-match an
empty string means that we don't want to do any filtering and should
be stored as NULL.
2016-03-16 17:32:17 +01:00
Beniamino Galvani
2f45aaa55f supplicant: honor the domain-suffix-match properties 2016-03-16 17:32:17 +01:00
Beniamino Galvani
945c459f20 cli: add support for NMSetting8021x domain-suffix-match properties 2016-03-16 17:32:17 +01:00
Beniamino Galvani
a4b4e0bc5b ifcfg-rh: add support for domain-suffix-match properties 2016-03-16 17:32:17 +01:00
Beniamino Galvani
64b76ba906 libnm-core: add domain-suffix-match properties to NMSetting8021x
The new domain-suffix-match and phase2-domain-suffix-match properties
can be used to match against a given server domain suffix in the
dNSName elements or in the SubjectName CN of the server certificate.

Also, add a comment to the old subject-match properties documentation
to suggest that they are deprecated and should not be used anymore.
2016-03-16 17:32:17 +01:00
Thomas Haller
c1383371cc NEWS: minor update referencing 1.0.10 release 2016-03-16 12:29:46 +01:00
Lubomir Rintel
8f82fa83ce ethernet: set the connection type when generating the connection
Otherwise the connection wouldn't verify:

  <error> [1458066126.2270] device (eth10): Generated connection does not verify:
    connection.type: property type should be set to '802-3-ethernet'
  <debug> [1458066126.2271] manager: (eth10): can't assume; no connection

(cherry picked from commit 4b71939e9ac3df93bfe72af0eac42b4ebaf94e15)
2016-03-16 11:38:00 +01:00
Thomas Haller
ecd42cd915 libnm-util: reword code comment 2016-03-15 18:53:24 +01:00
Thomas Haller
35586da48e libnm-util: add comment for return value of nm_connection_replace_settings_from_connection()
nm_connection_replace_settings_from_connection() can safely be used
to copy an invalid connection. The return value only says, whether
the connection is valid after the fact.
2016-03-15 18:51:49 +01:00
Thomas Haller
c7aea6b620 platform: use gint32 for monotonic-timestamp seconds
@now is obtained via nm_utils_get_monotonic_timestamp_s(),
which is gint32 (although it will never be negative).

Use the correct type.
2016-03-15 18:28:43 +01:00
Thomas Haller
6cb7322465 platform: remove padding for IP address lifetimes
We used to pad the lifetime since the beginning (commit
f121995fad).

However, there is not race involved, since our platform cache
is in sync with the messages from kernel (which didn't used to
be the case).

Also, when receiving a RA with a zero preferred time, we must
not extend the address lifetime by 5 seconds, but instead deprecate
the address immediately.

https://bugzilla.gnome.org/show_bug.cgi?id=763513
2016-03-15 18:28:43 +01:00
Beniamino Galvani
ca5da5d80f device: fix handling of available connections
The prune list is for elements that must be deleted from the list of
available connections. So, when processing all the existing
connections an element must be deleted from the prune list iff it's
available.

Fixes: 8b2abe0e2c

https://bugzilla.redhat.com/show_bug.cgi?id=1316488
2016-03-15 17:38:58 +01:00
Thomas Haller
7037e0b374 platform: merge branch 'th/netns-aware-bgo763323'
https://bugzilla.gnome.org/show_bug.cgi?id=763323
2016-03-15 12:56:59 +01:00
Thomas Haller
46f5c07643 platform: add nmp_netns_bind_to_path() helper function
Based-on-patch-by: Stjepan Gros <stjepan.gros@gmail.com>
2016-03-15 12:56:59 +01:00
Thomas Haller
3428d8607d platform: support switching partial namespaces
Previously, the push/pop API to switch between namespaces would always
switch both the net and mount namespace together.

There are situations, where we want to only switch one namespace.
For example, the function nmp_netns_bind_to_path() introduced next
only wants to switch the net namespace to get /proc/self/ns/net,
but must not switch the mount namespace as it bind-mounds in the
namespace of the caller.
2016-03-15 12:56:58 +01:00
Thomas Haller
a0cce2b195 platform/tests: add test for nm_platform_link_set_netns() 2016-03-15 12:56:58 +01:00
Thomas Haller
ad345cdf7d platform/tests: pass platform argument to nmtstp helper functions
Make the test helper independent from the platform singleton instance.
That way, we can also use them for other platform instances (e.g. in a
different namespace).
2016-03-15 12:56:58 +01:00
Stjepan Gros
9995699116 platform: add nm_platform_link_set_netns() function
[thaller@redhat.com: cherry-picked original patch and modified
  slightly]
2016-03-15 12:56:58 +01:00
Thomas Haller
30fe52c766 platform/tests: refactor creation of test_netns_general()
Need to add more then one netns test.
2016-03-15 12:56:58 +01:00
Thomas Haller
2eab5ed347 utils: inject platform into nm_utils_complete_generic() 2016-03-15 12:56:58 +01:00
Thomas Haller
56121fec83 route-manager: make NMRouteManager namespace aware 2016-03-15 12:56:58 +01:00
Thomas Haller
80136bed74 default-route-manager: make NMDefaultRouteManager namespace aware 2016-03-15 12:56:58 +01:00
Thomas Haller
fc53700fce default-route-manager: use explict platform instance instead of NM_PLATFORM_GET singleton 2016-03-15 12:56:58 +01:00
Thomas Haller
3ba9444728 rdisc: make NMRDisc namespace aware 2016-03-15 12:56:58 +01:00
Thomas Haller
a0c8f9c345 rdisc/trivial: adjust indention in nm_rdisc_class_init() 2016-03-15 12:56:58 +01:00
Thomas Haller
c924aae14a platform: add defines for "/proc/self/ns/" paths 2016-03-15 12:56:57 +01:00
Thomas Haller
7df7619e22 platform: properly change netns in do_change_link() 2016-03-15 12:56:57 +01:00
Thomas Haller
b5c8d496c2 nmtst: add NMTST_DEBUG option "D" 2016-03-15 12:56:57 +01:00
Lubomir Rintel
d6c399b1dd systemd: fall back to CLOCK_MONOTONIC
https://github.com/systemd/systemd/pull/2843
2016-03-15 12:53:19 +01:00
Lubomir Rintel
93bc9c0294 ocd: style fix 2016-03-15 09:18:16 +01:00
Lubomir Rintel
0adac47922 ifupdown: style fixes 2016-03-15 09:18:01 +01:00
Lubomir Rintel
c4fed9bd36 ifnet: fix error handling
Oh my.
2016-03-15 09:00:03 +01:00
Lubomir Rintel
12063468a3 ifnet: fix a possible NULL dereference
CID 75367 (#1 of 1): Dereference null return value (NULL_RETURNS)
30. dereference: Incrementing a pointer which might be null: pos.
2016-03-15 09:00:03 +01:00
Lubomir Rintel
4e0968182c nmp-netns: fix error handling
GError is not used, the error branch would always result in NULL dereference.

Also, check for the result being zero for clarity -- it's the only allowed
success indication.

CID 75365 (#3 of 3): Explicit null dereferenced (FORWARD_NULL)
12. var_deref_op: Dereferencing null pointer error.
2016-03-15 09:00:03 +01:00
Beniamino Galvani
ff97494e78 cli: fix memory leak in connection listing 2016-03-14 22:18:17 +01:00