Commit Graph

9141 Commits

Author SHA1 Message Date
Thomas Haller
39cbe772a6 core/rdisc: add autoconf addresses as /64 (instead of /128)
This feature needs support from the kernel and libnl.

If there is no system support, NM acts as before, adding the
autoconf address as /128. It does so, to prevent the kernel
from adding a route for this prefix. With system support, we
add the address as /64 and set the flag IFA_F_NOPREFIXROUTE.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 17:04:36 +01:00
Thomas Haller
7841f9ea0a core/platform: add check_support_kernel_extended_ifa_flags function
The kernel adds a new capability to allow user space to manage
temporary IPv6 addresses. We need to detect this capability
to act differently, depending on whether NM has an older kernel
at hand.

This capability got introduced together when extending the
ifa_flags to 32 bit. So, we can check the netlink message,
whether we have such an nl attribute at hand.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 17:04:36 +01:00
Thomas Haller
2bc61d1ad3 core/platform: workaround new address flag in address_to_string
The kernel and libnl adds two new flags IFA_F_MANAGETEMPADDR
and IFA_F_NOPREFIXROUTE. Older versions of libnl do not recognize
this flag, so add a workaround to nm_platform_ip6_address_to_string()
to show "mngtmpaddr" and "noprefixroute", respectively.

Also, add function nm_platform_check_support_libnl_extended_ifa_flags()
that checks whether libnl supports extended ifa_flags that were
added recently.

Extended flags and the two ifa-flags above were added to libnl in close
succession.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 17:04:36 +01:00
Thomas Haller
84dc64c8af core/rdisc: limit the number of autoconf addresses to 'max_addresses'
NetworkManager uses the sysctl value 'max_addresses' as the kernel does.
There is however a difference in what addresses are taken into account.
The kernel counts all addresses on the interface (including temporary,
private addresses and user configured ones).
NM instead only limits the number of public autoconf addresses to
'max_addresses'. This is because it is difficult for NM to count all
addresses (which can come from different sources) and it is not
necessarily a more logical behavior. Only be aware, that NM uses
the same config value as the kernel, but counts differently.

Especially, the kernel might reach the limit earlier then NM in the
presence of temporary addresses or addresses not from SLAAC.

Note, that the kernel uses 'max_addresses' only to limit public, autoconf
addresses. So this limit does not affect NM adding as many addresses as
it wants.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 17:04:36 +01:00
Thomas Haller
616fdb35ea core/platform: fix passing wrong type to variadic function nl_socket_add_memberships
nl_socket_add_memberships expects a variadic list of int,
NULL is possibly defined as ((void *) 0) or 0L.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 17:03:43 +01:00
Thomas Haller
2fd8d40a5a core/platform: silence error about reading sysctl file phys_port_id
It is common that the file exists, but cannot be read
(Operation not supported). So, silence any error when
reading the phys_port_id file.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 16:34:06 +01:00
Thomas Haller
f9022b8fb3 core: fix recently introduced crash in nm-manager
find_master() does not (always) set the output parameters. Initialize
paramter to NULL before calling find_master().

Just introduced recently with commit 8123cd2410.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 16:25:05 +01:00
Thomas Haller
bd7e647914 core: minor fix in calculating timeouts for connection retry
The previous version is not severely wrong, it is just be better
to treat connections whose retry block expires *now* as ready to
reconnect.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 16:01:28 +01:00
Thomas Haller
c960d474fb cli/bash-completion: make 'ifname' a mandatory parameter for nmcli connection add
For some connection types (bond, bridge, team and vlan), 'ifname' is
optional.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 15:44:16 +01:00
Dan Winship
796c3c0a77 core: fix a crash with autoconnect masters with autoconnect slaves (rh #1054194) 2014-01-30 09:12:04 -05:00
Dan Winship
8123cd2410 core: fix a crash with autoconnect masters with autoconnect slaves
If a master and at least one of its slaves were both autoconnect,
NMManager would end up creating two NMActiveConnections for the master
(one when the master itself is activated, and a second when the slave
is activated and calls ensure_master_active_connection(). (This
probably got broken when we changed it so ACs were created before
their devices.)

Fix this by checking for an existing master AC before creating one.
2014-01-30 09:12:04 -05:00
Dan Winship
a99ecb5405 core: Tighten up find_master() and ensure_master_active_connection() semantics
Return activation errors in a few edge cases rather than doing the wrong thing.
2014-01-30 09:12:04 -05:00
Dan Winship
8e391dc361 core: make find_master() return a GError on failure 2014-01-30 09:12:04 -05:00
Dan Winship
22c3a813dd core: Fix the find_master() and ensure_master_active_connection() docs
These two functions have confusing semantics, so document them in
better detail (which also highlights some bugs).
2014-01-30 09:12:04 -05:00
Thomas Haller
da40e0bc06 build: fix error when building with different build directory
Fixes build failure introduced by 4b2533fc00

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 12:50:40 +01:00
Thomas Haller
ffc3d9ced6 core: make NMDeviceTun 'mode' immutable and set at construct time
The 'mode' must be known from the beginning and changing it later on
would not be supported/meaningful. So, enforce this by setting the
property at construct time only.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 11:53:32 +01:00
Thomas Haller
4b2533fc00 core/tun: make reading of tun properties more robust
There seems to be the possibility of a race while reading tun
properties from sysctl. In this case, when being unable to
read the properties at construction of NMDeviceTun, we retry
shortly after.

- let tun_get_properties() not log any errors and it
  does not stop on the first error but tries to read all
  the values. Also, it initializes all fields of the output
  structure with a default value (NULL).

- hard code kernel flag #ifndef in header files. Even if the
  flag IFF_MULTI_QUEUE is not defined at compile time of NM,
  it could still be supported by the kernel (eg. when booting
  a newer kernel then the installed kernel headers). Simply
  hard code the value, this value is not ever going to change
  anyway.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 11:53:32 +01:00
Thomas Haller
634e4c99c3 platform: add parameter to nm_platform_sysctl_get() to suppress logging error
In some cases, an error when reading the sysctl value can be expected.
In this case, we want to suppress the error message

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 11:53:32 +01:00
Jiří Klimeš
11cce07c66 Allow saving connection profile as temporary in nmcli (bgo #723175)
'nmcli con add' has a new '[save yes|no]' argument.
'nmcli con edit' 'save' command has changed to 'save [persistent|temporary]'.

https://bugzilla.gnome.org/show_bug.cgi?id=723175
2014-01-30 10:55:12 +01:00
Thomas Haller
6d25080e6a cli/bash-completion: complete 'save' option for nmcli connection add
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 10:49:51 +01:00
Jiří Klimeš
ec0f629ed2 cli: persistent vs. temporary save for 'nmcli con edit' 2014-01-30 10:49:51 +01:00
Jiří Klimeš
2d523bd800 cli: allow creating temporary (unsaved) connection with 'nmcli con add' 2014-01-30 10:49:51 +01:00
Thomas Haller
97ededafd9 libnm-glib: fix leak in nm_remote_connection_get_secrets
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 10:40:51 +01:00
Thomas Haller
fbdca67baa po: fix newline differences in translations
msgfmt fails if the newline of the message is not matched by the
translation. Fix it.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-29 15:13:58 +01:00
Krishna Babu K
4dabe28868 po: update Telugu (te) translation (bgo #723231)
https://bugzilla.gnome.org/show_bug.cgi?id=723231

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-29 13:57:49 +01:00
Rajesh Ranjan
7c7b026e9c po: update Hindi (hi) translation (bgo #723227)
https://bugzilla.gnome.org/show_bug.cgi?id=723227

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-29 13:21:42 +01:00
Hedda Peters
81ce43bdb8 po: update German (de) translation (bgo #723207)
https://bugzilla.gnome.org/show_bug.cgi?id=723207

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-29 10:08:31 +01:00
Thomas Haller
fa81901ed8 core/platform: replace strcpy by g_strlcpy
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-28 20:19:29 +01:00
Thomas Haller
c9e241e2f9 ifcfg-rh: change algorithm for svUnescape
The previous algorithm had runtime complexity O(n^2). Change
it to O(2*n).

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-28 19:19:49 +01:00
Dan Winship
ff350c04c0 core: fix crash when connecting to new Wi-Fi network (bgo #723163)
If the user is AddAndActivating a new network, the connection may not
have an NMSettingConnection yet, but we know that once it does, the
user will be authorized.
2014-01-28 12:09:22 -05:00
Thomas Haller
9694723f08 tui/po: fix po/POTFILES.in referencing invalid file
Fix removing a file 36ed2e91bb.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-28 17:12:24 +01:00
Dan Winship
6096ba797f Import some libnm-gtk functionality into libnm-util/libnm-glib (bgo #720844)
nmtui was using local copies of some functions that were originally in
libnm-gtk. Move them into the appropriate places in libnm-util and
libnm-glib instead.
2014-01-27 15:41:55 -05:00
Thomas Haller
0ee3f23534 tui: use nm_remote_settings_get_connection_by_id()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-27 15:39:51 -05:00
Thomas Haller
f76934de15 libnm-glib: add function nm_remote_settings_get_connection_by_id()
Utility function, to search the list of connections for a connection
with a matching id/name. Returns the first match.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-27 15:39:51 -05:00
Dan Winship
36ed2e91bb tui: use the new libnm-util/libnm-glib device/connection utils
Use the new methods copied into libnm-util/libnm-glib from libnm-gtk,
and remove nmtui's local copies.
2014-01-27 15:39:51 -05:00
Dan Winship
f7b1b28202 libnm-util, libnm-glib: add device/connection describing functions
Add functions to describe and disambiguate devices and connections for
display to the user. Originally from libnm-gtk.
2014-01-27 15:39:51 -05:00
Dan Williams
078d177874 ifcfg-rh: add tests for Team master and port 2014-01-27 12:49:55 -06:00
Dan Williams
76c3bd9898 ifcfg-rh: unescape Team configuration (rh #1051517)
4f3a9cca6f stopped unescaping Team
configuration when reading ifcfg files due to inefficient algorithms
in svUnescape().  Unfortunately, since Team configuration is escaped
when written out, reading it in creates invalid configuration that
teamd rejects.

The pathological case was a 9MB invalid Team configuration. Since a
Team configuration will never, ever be that large, fix the issue by
warning the user or rejecting the configuration if it is over 20000
bytes in size (an arbitrary number).  Thus svUnescape() will never
be called with huge strings, but the configuration is still unescaped.

https://bugzilla.redhat.com/show_bug.cgi?id=1051517
2014-01-27 12:49:55 -06:00
Jiří Klimeš
df4c9347fc libnm-glib: chain up the parent constructed() of NMRemoteConnection 2014-01-27 17:39:29 +01:00
Jiří Klimeš
2c11fd477c introspection: add PropertiesChanged signal for o.f.N.Settings.Connection
Some users, e.g. libnm-glib's NMRemoteConnection, use it to get changes of
properties.
2014-01-27 17:39:22 +01:00
Jiří Klimeš
0bba6e77e5 man: update dispatcher scripts description in NetworkManager(8) manual page 2014-01-27 13:27:41 +01:00
Sandeep Shedmake
828da6e9ee po: update Marathi (mr) translation (bgo #723044)
https://bugzilla.gnome.org/show_bug.cgi?id=723044

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-26 21:48:30 +01:00
Nilamdyuti Goswami
59a585aeb5 po: update Assamese (as) translation (bgo #723006)
https://bugzilla.gnome.org/show_bug.cgi?id=723006

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-26 21:41:58 +01:00
Nilamdyuti Goswami
f2496dea8c po: update Assamese (as) translation (bgo #722966)
https://bugzilla.gnome.org/show_bug.cgi?id=722966

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-25 18:33:11 +01:00
Dan Williams
199ef9320e trivial: reorgranize some NMManager functions
No code changes at all, just moving GObject-related functions to
the bottom of the file per NM conventions.
2014-01-24 13:43:50 -06:00
Dan Williams
891dcfad7d core: more usage of g_signal_handlers_disconnect_by_func() 2014-01-24 13:43:46 -06:00
Dan Williams
505248b0ce core: use g_signal_handlers_disconnect_by_func() to simplify some code 2014-01-24 13:43:19 -06:00
Dan Williams
016dbcc99e core: provide useful error messages to main() on Manager creation failure 2014-01-24 13:14:05 -06:00
Dan Williams
e62b212be3 core: exit cleanly if D-Bus cannot be initialized (rh #1057738)
Instead of crashing, let's exit cleanly.
2014-01-24 13:14:04 -06:00
Dan Williams
c9b6f13c56 policy: fix policy after dcbw/kill-at-console merge (bgo #707983) (rh #979416)
Polkit documentation suggests that <allow_any> applies to all
clients, but that's actually not the case.  allow_any,
allow_inactive, and allow_active are evaluated individually based
on whether the user is local and active (allow_active), local and
inactive (allow_inactive), and not local (allow_any).  Thus all
three allow options must be specified for any authorization other
than 'no'.
2014-01-24 12:32:43 -06:00