Commit Graph

14291 Commits

Author SHA1 Message Date
Thomas Haller
be4472bdcd platform: call ethtool functions via platform
When adding namespace support later, we must call ethtool
from the proper namespace, i.e. via a NMPlatform instance.

Avoid calling ethtool directly.
2016-03-01 15:07:04 +01:00
Thomas Haller
98d14b0c15 systemd/tests: add test_lldp_create() test
This test makes sense because "test-systemd" is not
linked against any other systemd library. So this test
verifies that our libsystemd clone is self contained.
2016-03-01 13:50:16 +01:00
Beniamino Galvani
e0abe36ae7 release: bump version to 1.1.91 (1.2-beta2) 2016-03-01 13:14:46 +01:00
Thomas Haller
67134e7141 core: merge branch 'th/build-core'
Add a test "test-systemd" which links against our copy
of systemd code and a minimal core library. For that,
cleanup and split NetworkManagerUtils.h.
2016-03-01 12:54:22 +01:00
Thomas Haller
51e292885c systemd/tests: add test util for systemd
Most interestingly is also, whether we can link libsystemd.a without
having undefined references (which might be wrongly satisfied by an
externally loaded libsystem shared library.
2016-03-01 12:42:42 +01:00
Thomas Haller
adb56d137e core: split "nm-core-utils.h" out of "NetworkManagerUtils.h"
"NetworkManagerUtils.h" contains a bunch of helper tools for core
daemon ("src/").

Unfortunately, it has dependencies to other parts of core,
such as "nm-device.h" and "nm-platform.h". Split out a part
of tools that are independent so that they can be used without
dragging in other dependencies.

"nm-core-utils.h" should only use libnm-core, "nm-logging.h"
and shared.

"NetworkManagerUtils.h" should provide all "nm-core-utils.h" and
possibly other utilities that have larger dependencies.
2016-03-01 12:42:42 +01:00
Thomas Haller
e4a7502a2c logging: make logging independent of platform
"nm-logging.h" is a basic core module that should have few other
dependencies. Instead of letting nm-logging.c directly call a function
from "nm-linux-platform.c", let platform register a handler as needed.

This way, you can build a core library containing nm-logging but no
nm-platform.
2016-03-01 12:42:42 +01:00
Thomas Haller
60ca6e028f lldp/tests: fix memleaks in test
valgrind complains since commit ae9cc8910d.
2016-03-01 12:41:38 +01:00
Beniamino Galvani
24e3306b87 release: update NEWS 2016-03-01 09:56:14 +01:00
Beniamino Galvani
da01b81ff4 merge: branch 'bg/vlan-reorder-hdr-bgo762626'
https://bugzilla.gnome.org/show_bug.cgi?id=762626
2016-02-29 18:23:15 +01:00
Beniamino Galvani
da70fbd7d5 libnm-core: remove special handling of missing VLAN_FLAGS
On older NM versions the default value for vlan.flags was 0, but then
the actual value set on interfaces was REORDER_HDR. In order to
maintain backwards compatibility in behavior, remove the special
handling of vlan.flags so that a missing key is treated as the default
value REORDER_HDR.

https://bugzilla.gnome.org/show_bug.cgi?id=762626
2016-02-29 18:11:17 +01:00
Beniamino Galvani
2e5e7285a8 ifcfg-rh: change the handling of REORDER_HDR flag
On NM 1.0 connections were created by default without the REORDER_HDR
flag, but then due to a bug in platform code (fixed in [1]), the
kernel interface always had the flag set.

Now that the setting is honored, users upgrading to the new version of
NM will see a change from the previous behavior, since interfaces will
not have REORDER_HDR and this will certainly break functionality.

The only solution here seems to be to ignore the REORDER_HDR variable
in ifcfg files (since it never had any effect) and introduce a new
NO_REORDER_HDR option for the VLAN_FLAGS variable which allows to turn
the flag off. The consequence is that the flag will be set for all old
connections.

This change introduces an incompatibility with initscripts, however is
necessary to avoid breaking user functionality upon upgrade.
Connections created through NetworkManager will still be parsed
correctly by initscripts (since we always write the REORDER_HDR
variable).

[1] db62fc9d72 ("platform: fix adding VLAN flags")

https://bugzilla.gnome.org/show_bug.cgi?id=762626
2016-02-29 18:11:17 +01:00
Thomas Haller
eb80f69098 utils: add nm_utils_strbuf_init() macro 2016-02-29 17:46:41 +01:00
Thomas Haller
7f43e0a7b3 platform/trivial: rename NMPlatformIP6Address's "flags" field to "n_ifa_flags"
There are far too many "flags". Rename the "flags" to "n_ifa_flags"
which reminds to "ifa_flags" in 'struct ifaddrmsg', but with a
distinctive "n_" prefix.
2016-02-29 16:27:08 +01:00
Thomas Haller
e18cdc10d3 platform: adjust type of IPv6 address flags to guint
Address flags inside 'struct ifaddrmsg' are uint8_t and they are
extended to uint32_t via IFA_FLAGS.

Change it to be guint32.
2016-02-29 16:27:08 +01:00
Thomas Haller
83d8a9e094 platform: streamline fields in platform's structures
- sort the fields to better fill gaps due to alignment.
- use "bool" bitfield instead of gboolean.
2016-02-29 16:04:54 +01:00
Thomas Haller
866925e65c platform/trivial: rename NMPlatformLink's "flags" field to "n_ifi_flags"
There are far too many "flags". Rename the "flags" to "n_ifi_flags"
which reminds to "ifi_flags" in 'struct ifinfomsg', but with a
distinctive "n_" prefix.
2016-02-29 15:56:01 +01:00
Thomas Haller
41b46f1393 platform: adjust type of link flags to guint
The type of ifi_flags is unsigned, not uint32_t.
2016-02-29 15:53:19 +01:00
Thomas Haller
18421e2fe8 systemd,lldp: merge branch 'th/systemd-lldp' 2016-02-29 14:26:16 +01:00
Thomas Haller
ae9cc8910d lldp/tests: unref lldp instance in test 2016-02-29 14:23:22 +01:00
Thomas Haller
06252c9863 lldp: handle NULL values in lldp_neighbor_id_hash()
g_str_hash() can not be called with NULL. Ensure that we don't crash.
Thereby, refactor the hashing algorithm because the chassis-id and
port-id are small numbers and xor-ing can cancel them easily.
2016-02-29 14:23:22 +01:00
Thomas Haller
c130a3b39a lldp: don't mix malloc() with g_malloc() 2016-02-29 14:23:22 +01:00
Thomas Haller
2a466216e1 lldp: refactor logging to use _LOG() macros 2016-02-29 14:23:22 +01:00
Thomas Haller
a3f9115c0b lldp: fix calling free on memory returned by systemd
systemd's malloc() must be matched by free() and not g_free().
Thereby, use a cleanup attribute.
2016-02-29 14:08:00 +01:00
Thomas Haller
bd797e9fe1 lldp: refactor process_lldp_neighbors() 2016-02-29 14:08:00 +01:00
Thomas Haller
3a81c0f301 macros: add nm_auto() macro to cleanup functions 2016-02-29 14:08:00 +01:00
Thomas Haller
bf29d02ac1 systemd: don't include "nm-sd-adapt.h" in systemd header files
The header files are not compiled directly, but always included while compiling
other source files. We already require every source file to include "nm-sd-adapt.h"
as first, thus we don't need the include in the headers too.
2016-02-29 14:08:00 +01:00
Thomas Haller
ce4b1dc891 build: sort files for libsystemd_nm_la_SOURCES alphabetically 2016-02-29 14:07:59 +01:00
Beniamino Galvani
4ded98dd0f cli: fix use-after-free when adding ADSL connections
check_adsl_protocol() can free and assign a new string to
@protocol_ask, leaving @protocol dangling. Fix this.

Fixes: 290c1626b9
2016-02-29 13:47:47 +01:00
Beniamino Galvani
1c0fb2f652 introspection: fix description for vxlan ageing property 2016-02-29 13:47:47 +01:00
Thomas Haller
5805683efc device: fix compile error due to typo
Fixes: 6d409653b1
2016-02-29 13:38:14 +01:00
Thomas Haller
547980d2e4 device/trivial: adjust whitespace for property definitions 2016-02-29 13:13:54 +01:00
atul
6d409653b1 device: use _notify() instead of g_object_notify() for object properties
https://github.com/NetworkManager/NetworkManager/pull/3
2016-02-29 13:10:02 +01:00
Lubomir Rintel
faf70df480 device: the veth should have the same priority as ethernet
It's supposed to be a virtual ethernet.
2016-02-27 20:15:56 +01:00
Lubomir Rintel
f541a17270 device: when activating without cloned-mac-address, set the permanent one
Don't rely on what's already on the device. It could be that the MAC address
set on the device is not meaningful -- the NM crashed while two devices were
teamed together and now they have the same hardware address and now it's
impossible to bond them with mode=5.
2016-02-26 17:35:21 +01:00
Thomas Haller
ec35542cd5 wifi/test: fix bug in test code wpa_flags_for_idx() 2016-02-26 16:32:24 +01:00
Thomas Haller
6adf25c53c contrib/rpm: print dnf-install command at the end of build.sh 2016-02-26 14:36:49 +01:00
Lubomir Rintel
02278d3b8f arping-manager: failure to get a device name should not be fatal
The device could just be removed mid-flight.
2016-02-26 13:37:01 +01:00
Beniamino Galvani
aae6f07fe5 device: trivial: fix indentation and whitespaces 2016-02-25 11:10:52 +01:00
Thomas Haller
ff527652c7 callouts: downgrade logging severity of messages to g_info() and g_debug()
In dispatcher, we install a log-handler which maps G_LOG_LEVEL_MESSAGE
to syslog priority LOG_NOTICE, which in turn causes journal to highlight
the message. We don't want that so instead use g_info() and g_debug()
which maps to lower syslog levels.

There is only one problem, in debug-mode, we don't use syslog but the
default logging handler from glib. In this case, we have to set
G_MESSAGES_DEBUG otherwise g_info()/g_debug() is suppressed.
2016-02-24 20:04:29 +01:00
Thomas Haller
17779975c8 nm-glib: backport g_info() macro 2016-02-24 20:04:29 +01:00
Beniamino Galvani
22b3494de6 libnm,core: fix syntax of 'transfer' annotation 2016-02-24 17:23:01 +01:00
Lubomir Rintel
36573225b6 ifcfg-rh: add test for BOOTPROTO=autoip
Previous commit fixed parsing of these connection; let's check that we don't
regress there.
2016-02-24 16:54:27 +01:00
Lubomir Rintel
2e2f56697f ifcfg-rh: short circuit the IP configuration parsing on IPv4LL
We need the other keys, such as may_fail, too.
2016-02-24 16:54:27 +01:00
Lubomir Rintel
7d1709d7f6 device: check may_fail when progressing to IP_CHECK
Don't let the device progress to check and then in turn to activated unless all
the required IP configuration is in place.
2016-02-24 16:54:26 +01:00
Lubomir Rintel
9a55f662b9 device/trivial: rename nm_device_check_ip_failed()
This saves 110 bytes (which is 1/29986680757 of the size of the books in the
Library of Congress).

Also, the function is static; not using the nm_device_ prefix is preferred.
2016-02-24 16:54:26 +01:00
Dan Williams
751a37bf43 wifi: ignore monitor interfaces
If a monitor interface is created, NM will grab that interface
and change it to station mode.  That's not very nice.

https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00068.html
2016-02-24 11:43:42 +01:00
Thomas Haller
b913e1d641 platform: optimize sysctl_set() to use stack allocated buffer
The value written to sysctl is usually a short string. It makes sense
to optimize for this case and avoid allocating a temporary string
on the heap.

An alternative would be to use writev(), which effectively does the same
and also creates a temporary buffer (preferably stack allocated).

https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00070.html
2016-02-24 11:24:13 +01:00
Thomas Haller
f41aebf897 device: merge branch 'jk/device-types-bgo762538'
https://bugzilla.gnome.org/show_bug.cgi?id=762538
2016-02-23 23:17:40 +01:00
Thomas Haller
1b00009169 device: add new NMDeviceType NM_DEVICE_TYPE_VETH
Based-on-patch-by: Jiří Klimeš <jklimes@redhat.com>
2016-02-23 23:15:37 +01:00