Commit Graph

15047 Commits

Author SHA1 Message Date
Thomas Haller
6e06a7d4a1 core: match the NMSettingBridge:mac-address in NMDeviceBridge:check_connection_compatible()
https://bugzilla.gnome.org/show_bug.cgi?id=729844

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-30 17:02:31 +02:00
Thomas Haller
1701a70b9e core: set NMSettingBridge:mac-address when creating new bridge
This feature requires recent support from the kernel.

Most notably these upstream kernel commits are required:
 -  92c0574f11598c8036f81e27d2e8bdd6eed7d76d
 - 43598813386f6205edf3c21f1fe97f731ccb4f15
 - 30313a3d5794472c3548d7288e306a5492030370

The latter of them was merged to upstream kernel version 3.15-rc5.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-30 17:02:31 +02:00
Thomas Haller
891eb83f45 libnm-util: add property NM_SETTING_BRIDGE_MAC_ADDRESS to NMSettingBridge
https://bugzilla.gnome.org/show_bug.cgi?id=729844

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-30 17:02:31 +02:00
Thomas Haller
968b468b2f platform: allow setting address when adding software link (bridge)
Add an additional address parameter to link_add/bridge_add, to set the
MAC address of software devices.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-30 17:02:31 +02:00
Dan Williams
a03a76ea60 bluez: fix incorrect error code comparing Bluetooth connections
C&P error in my commit 4674f10399.
2014-05-30 09:35:42 -05:00
Thomas Haller
00a6f9dcf9 Merge branch 'th/nm_utils_hwaddr_ntoa_len'
https://mail.gnome.org/archives/networkmanager-list/2014-May/msg00046.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-30 11:41:12 +02:00
Dan Williams
4674f10399 bluez: store Bluetooth address as an array not a string
It's only ever used as an MAC address array, so we might as well
make it one instead of a string.  Saves a memory allocation and
some cycles converting back and forth.

This also fixes a bug, where NMDeviceBt:check_connection_compatible()
would not set GError on mismatch of bdaddr.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-30 11:32:37 +02:00
Thomas Haller
7013014744 core: refactor to use nm_utils_hwaddr_ntoa_len() instead of printf()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-30 11:32:20 +02:00
Thomas Haller
002718ec0f ifnet: refactor to use nm_utils_hwaddr_ntoa_len() instead of printf()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-30 11:32:20 +02:00
Thomas Haller
40110d3568 ifcfg-rh: refactor writer to use nm_utils_hwaddr_ntoa_len()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-30 11:32:20 +02:00
Thomas Haller
b15fea034d ifcfg-rh: add helper svSetValue_free()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-30 11:32:20 +02:00
Thomas Haller
fedf7ca303 libnm-util: optimize nm_utils_hwaddr_ntoa_len()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-30 11:32:20 +02:00
Jiří Klimeš
a7fa1aed1b trivial: clarify comments in test-general.c and NetworkManagerUtils.c 2014-05-30 09:21:02 +02:00
Jiří Klimeš
fbdf8857c3 core: take over connections with IPv6 method 'ignore' for 'auto' (rh #1083196)
If we had a connection with IPv6.method = ignore, we simply ignored IPv6. So
we should assume this connection even if there is an SLAAC address on the
interface.

https://bugzilla.redhat.com/show_bug.cgi?id=1083196
2014-05-30 09:20:55 +02:00
Thomas Haller
b5a94ae479 merge branch 'jk/keyfile-mac-fix' (bgo #730514)
https://bugzilla.gnome.org/show_bug.cgi?id=730514
2014-05-29 19:01:35 +02:00
Thomas Haller
d426ed28c2 keyfile: stricter checking for invalid HWADDR length in mac_address_parser()
When reading a hardware address in keyfile plugin, check for the
expected length already in mac_address_parser().

Before, we would call the deprecated function nm_utils_hwaddr_type()
to see if it can be some kind of MAC address. In that case, the error
was caught later during NMSetting:verify().

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-29 19:01:00 +02:00
Thomas Haller
415c86eb9a keyfile: don't check HWADDR length in mac_address_writer()
When converting the MAC address to keyfile value, simply accept
any given byte array and pass it to nm_utils_hwaddr_ntoa_len().
This no longer restricts the length of accepted addresses as known by
nm_utils_hwaddr_type(). It is up to the caller to perform any validation
of the MAC address.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-29 19:01:00 +02:00
Thomas Haller
c4d90c5660 cli: don't use nm_utils_hwaddr_type() to stringify HWADDR
Use nm_utils_hwaddr_ntoa_len() instead of nm_utils_hwaddr_ntoa().
This makes it no longer necessary to determine the type of the MAC
address based on the address length.

This makes the GETTER more accepting towards other lengths.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-29 19:00:59 +02:00
Thomas Haller
3cda194b44 libnm-util: make hwaddr functions more robust against invalid arguments
- nm_utils_hwaddr_len() and nm_utils_hwaddr_type() no longer assert
  against known input types/lengths. Now they can be used to detect the
  hwaddr type, returning -1 on unknown.
- more checking of input arguments in nm_utils_hwaddr_aton() and
  related. Also note, that nm_utils_hwaddr_aton_len() has @len of type
  gsize, so we cannot pass on the output of nm_utils_hwaddr_len()
  without checking for -1.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-29 19:00:59 +02:00
Jiří Klimeš
dce6599ec0 keyfile: fix reading MAC in old format (list of integers)
Don't call nm_utils_hwaddr_type () with random len, because it causes ugly
  (NetworkManager:25325): libnm-util-CRITICAL **: file nm-utils.c: line 1989 (nm_utils_hwaddr_type): should not be reached

And add a testcase.

https://bugzilla.gnome.org/show_bug.cgi?id=730514
2014-05-29 19:00:41 +02:00
Jiří Klimeš
32b559044e dhcp: dhclient v6 stores address lifetimes in different variables (rh #1086237)
It uses 'new_max_life' for valid lifetime and 'new_preferred_life' for
preferred lifetime.

https://bugzilla.redhat.com/show_bug.cgi?id=1086237

See also https://bugzilla.redhat.com/show_bug.cgi?id=1032809
2014-05-29 11:49:28 +02:00
Jiří Klimeš
d7216505bb cli: do not restrict VPN type of created connections (rh #1100750)
There may be third-party VPN plugins nmcli is not aware of.
We still print a warning if nmcli doesn't know the type. It helps to catch up
typos.

https://bugzilla.redhat.com/show_bug.cgi?id=1100750
2014-05-28 09:37:15 +02:00
Jiří Klimeš
649e4be103 cli: extract username and gateway for some more VPN types 2014-05-28 09:37:15 +02:00
Thomas Haller
f0daf90298 platform: fix regression failing with ESRCH when deleting IPv4 routes
When deleting an IPv4 route, several fields must match (or be left
unspecified/zero). See fib_table_delete().

Previously, NM would look into the cache and use that object for
deletion. This was changed recently, thereby breaking the deletion
of routes by not specifying all properties as needed.

Fixes regression introduced by commit 019bf7512d.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-27 21:40:31 +02:00
Jiří Klimeš
98ae6e06d2 all: g_type_init() has been deprecated in GLib 2.35.0
g_type_init() deprecation:
https://bugzilla.gnome.org/show_bug.cgi?id=686161
2014-05-27 16:58:21 +02:00
Dan Winship
aba55670cc man: clarify the meaning of "nm-online --wait-for-startup"
https://bugzilla.gnome.org/show_bug.cgi?id=700651
2014-05-27 10:53:53 -04:00
Jiří Klimeš
6f9601030a cli: add missing reason-to-string mappings for NMDeviceStateReason 2014-05-26 14:07:01 +02:00
Jiří Klimeš
e6f1c8329f cli: TAB completion for connection.secondaries
We complete UUIDs, because that's easier (no spaces or special characters).
Readline display hook allows to display profile name too, though.
2014-05-23 12:19:29 +02:00
Jiří Klimeš
7696238e84 cli: only allow setting VPN connection as secondaries in editor 2014-05-23 12:19:29 +02:00
Jiří Klimeš
e3d1e176c2 libnm-util: make explicit that we only allow VPN as secondaries (rh #1094296)
https://bugzilla.redhat.com/show_bug.cgi?id=1094296
2014-05-23 12:19:29 +02:00
Christian Kirbach
258e3cfdf4 po: update German (de) translation (bgo #730330)
https://bugzilla.gnome.org/show_bug.cgi?id=730330

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-23 11:19:10 +02:00
Dan Williams
b1d2b14922 core: fix use-after-free in pending action remove debug message 2014-05-22 11:34:58 -05:00
Dan Williams
2af30e813a docs: clarify some uses of nm_active_connection_get_connection() 2014-05-22 09:07:57 -05:00
Jiří Klimeš
5aefa120f8 contrib/rpm: own some missing directories (rh #1099789)
https://bugzilla.redhat.com/show_bug.cgi?id=1099789

Based on hint from jpopelka@redhat.com
2014-05-21 16:23:23 +02:00
Thomas Haller
0d09472e45 contrib/rpm: adjust required bluez version in SPEC file for NetworkManager-bluetooth plugin
rhel-7.0 comes with bluez4, not bluez5

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-20 13:58:49 +02:00
Dan Williams
93fb403e10 contrib/rpm: clean up dependencies and plugins in NetworkManager.spec
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-19 18:55:59 +02:00
Dan Winship
6661531062 devices: fix link-changed refactoring
Thomas points out that the previous refactoring moved the
link_changed() virtual method invocation relative to
update_for_ip_ifname_change(), which could have weird side effects
given the things that can happen there. So move it back.
2014-05-19 09:58:11 -04:00
Thomas Haller
e3221e6a12 platform: merge branch 'th/bgo726273_platform_delete_ip4_route_workaround'
https://bugzilla.gnome.org/show_bug.cgi?id=726273

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-19 15:26:00 +02:00
Thomas Haller
019bf7512d platform: improve workaround for deleting IPv4 route with libnl guessing route scope
Previously, we always lookup the cache for libnl objects and used those for
delete_object(). This was necessary, because libnl guesses and overwrites
the IPv4 route scope.

Newer libnl no longer overwrites the scope if set explicitly to RT_SCOPE_NOWHERE.
So, this workaround is no longer needed. Indeed there might be cases, where it is
harmful, because we might guess the wrong scope.

This was fixed in libnl3 in commits
  85ec9c7ad8
  015c4ee59b

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-19 15:22:50 +02:00
Thomas Haller
ff801bcafc platform: add function _nl_has_capability() to access nl_has_capability() dynamically
The libnl function nl_has_capability() was only added recently, so don't depend on it
at compile time. Instead use dlopen to load the function if the libnl library contains it.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-19 15:22:46 +02:00
Tore Anderson
c2e99b181f contrib/rpm: force POSIX changelog date locale
Ensure the date in the generated changelog entry is in the POSIX locale
format. Otherwise rpmbuild might fail with "bad date in %changelog" due
to it not liking localised date formats.

https://mail.gnome.org/archives/networkmanager-list/2014-May/msg00034.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-19 14:51:48 +02:00
Dan Winship
950d9fff26 devices: refactor the link-changed code
Separate out the "ifindex changed" and "ip_ifindex changed" cases.
2014-05-19 08:25:56 -04:00
Dan Winship
01b7bef6b4 devices: improve slave release log messages
Rather than putting "success %d" in the message, log different
messages (at different priorities) for success and failure.
2014-05-19 08:24:54 -04:00
Dan Winship
c48ba1ab10 devices: fix "slaves" property notification in release_slaves
Bond, bridge, and team were notifying their "slaves" properties before
the slave actually got removed from priv->slaves, meaning that
anything that looked at the property directly from a notify::slaves
handler would see the old value. Fix that.
2014-05-19 08:24:54 -04:00
Dan Winship
1f22c8859a devices: flip the ordering of priv->slaves
Keep priv->slaves in the order that slaves were attached, rather than
in reverse order.

Among other things, this makes the errors from
nm_device_master_check_slave_physical_port() more consistent.
2014-05-19 08:24:54 -04:00
Jiří Klimeš
0b2f4979b1 trivial: remove empty 'vim' file accidentally added by e8f5a82 2014-05-16 09:15:32 +02:00
Jiří Klimeš
2b37ee2b7a cli: fix completion of interfaces in editor for "activate" command 2014-05-15 13:43:02 +02:00
Jiří Klimeš
e8f5a82e22 cli: fix ambiguity of "o" (on vs off) in nmc_string_to_bool() 2014-05-15 09:50:52 +02:00
Thomas Haller
66164c480d contrib/rpm: update build_clean.sh script to work with older version of git
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-14 15:19:24 +02:00
Thomas Haller
08e8b3bd13 contrib/rpm: update spec file adding new wifi plugin NetworkManager-wifi
Commit a544aa374e extracts the wifi device
into a shared library. Update the (currently broken) default spec file to
build the new package NetworkManager-wifi.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-14 14:31:57 +02:00