Commit Graph

13873 Commits

Author SHA1 Message Date
Thomas Haller
507599a2d2 trivial: fix whitespace and spelling error
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-10 11:18:40 +01:00
Stanislaw Gruszka
28dfb2e4a2 wifi: do not print dump inconsistency error for get scan command
Avoid printing "nl_recvmsgs() error: (-33) Dump inconsistency detected,
interrupted".  DUMP_INTR error is harmless for scan (see in code
comments).

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-10 11:18:40 +01:00
Stanislaw Gruszka
0cb256f5d7 core: normalize object paths on add_and_activate_connection
Without this patch I can not setup new hotspot connection.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-10 11:02:10 +01:00
Nilamdyuti Goswami
66f02fc3f9 po: update Assamese (as) translation (bgo #723751)
https://bugzilla.gnome.org/show_bug.cgi?id=723751

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-06 14:31:41 +01:00
Thomas Haller
8da98026da build: include the git commit id of HEAD in ./configure
`make dist` packs the 'configure' file in the tarball, so this is
useful, to include the commit id into the release tarball.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-05 17:13:23 +01:00
Ankitkumar Patel
918b0f2cd0 po: update Gujarati (gu) translation (bgo #723527)
https://bugzilla.gnome.org/show_bug.cgi?id=723527

Co-Authored-By: Sweta Kothari <swkothar@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-04 23:02:38 +01:00
Dan Winship
dd58d9c703 build: drop the libndp submodule
libndp has existed for a while now. 1.0 was released six months
ago. So drop the submodule and just require an installed package.
2014-02-03 12:13:41 +01:00
Dan Winship
736bc1c7db man: NetworkManager.conf.5 fixes and updates
The [main] section is not mandatory.

Clarify in several places that the keyfile plugin is always used for
fallback, and that the [keyfile] section is normally only used if you
aren't using any other plugin.

Fix some erroneous references to "keyfile" and "ifdown" in the
ifupdown section.

Update the ifcfg-rh docs to list all currently-supported connection
types.

Swap the order of ifcfg-suse and ifupdown to make them alphabetical.
(Note that ifnet is currently missing.)

https://bugzilla.gnome.org/show_bug.cgi?id=720841
2014-02-03 10:54:11 +01:00
Dan Williams
e922c120a3 libnm-glib: zero 'secrets' to prevent crash getting secrets
If the GetSecrets call returned an error (eg, no secrets) then
'secrets' isn't set by dbus_g_proxy_end_call() and is garbage,
then gets freed.
2014-01-31 15:22:16 -06:00
Dan Williams
3eeeb9fe0d wifi: indicate to the kernel when critical protocols start/stop (bgo #723241)
Add support for the kernel's Wi-Fi critical protocol indication to make
DHCP and IPv6 SLAAC more reliable.

https://bugzilla.gnome.org/show_bug.cgi?id=723241
2014-01-31 14:34:55 -06:00
Dan Williams
d18f524984 wifi: add nl80211 Critical Protocol indication support
At critical times during the connection process, especially during
DHCP and EAPOL, the driver can increase the reliability of communication
in an attempt to increase the possibility of success.  This could be
done by suppressing bluetooth for a short period, or locking in a low
(and thus more reliable) bitrate, or enforcing some other interference
protection.  The 3.10 kernel added nl80211 support for this, so lets
use it if we can.
2014-01-31 14:11:28 -06:00
Dan Winship
07edeabbc3 trivial: fix a coverity warning
"reserved" is unsigned, so CLAMP(reserved, 0, 8) does an unnecessary
check.
2014-01-31 19:49:52 +01:00
Thomas Haller
6c2f96421b core/platform: fix wrong warning log in nm-linux-platform
According to documentation, nl_rtgen_request() returns 0 on success.
Due to a bug (fixed upstream) in older libnl versions, nl_rtgen_request()
returns the number of bytes sent, which caused logging although
succeeding.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-31 14:54:33 +01:00
Thomas Haller
2e1db48e71 core: ensure proper handling of sysctl paths in NMDevice (set NULL on dispose)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-31 14:52:14 +01:00
Shankar Prasad
61efa27cac po: update Kannada (kn) translation (bgo #723361)
https://bugzilla.gnome.org/show_bug.cgi?id=723361

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-31 13:41:46 +01:00
Thomas Haller
84ea5b6302 core: minor change of logging output about monotonic_timestamp
Make it more clear, what the current monotonic_timestamp is and
what's it's offset to CLOCK_BOOTTIME.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-31 13:28:42 +01:00
Thomas Haller
5d6a5f8572 core/platform: add debug logging when adding/deleting addresses
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 20:31:29 +01:00
Thomas Haller
adbcd9a1f0 core: Merge branch 'th/get_monotonic_timestamp'
Add new functions nm_utils_get_monotonic_timestamp_*() to provide
means to get timestamps for calculating durations.
At several places, we used time() or clock_gettime() for that purpose.
Update and unify those places to make use of the new functions.

The new functions have the advantage, that the timestamps are guaranteed
to be positive and the timestamp is independent of clock adjustments.
Internally it uses CLOCK_BOOTTIME/clock_gettime.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 19:55:49 +01:00
Thomas Haller
3c6438c984 core: use nm_utils_get_monotonic_timestamp_s for nm-device-ethernet.c (last_pppoe_time)
https://bugzilla.gnome.org/show_bug.cgi?id=720833

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 19:54:10 +01:00
Thomas Haller
16605be6b8 core: use nm_utils_get_monotonic_timestamp_s for autoconnect_retry_time
https://bugzilla.gnome.org/show_bug.cgi?id=720833

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 19:54:10 +01:00
Thomas Haller
5aba4eaf6b core: use nm_utils_get_monotonic_timestamp_ms for nm-netlink-monitor
https://bugzilla.gnome.org/show_bug.cgi?id=720833

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 19:54:10 +01:00
Thomas Haller
81aed04da4 core: use nm_utils_get_monotonic_timestamp_s for nm_ap_set_last_seen
https://bugzilla.gnome.org/show_bug.cgi?id=720833

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 19:51:45 +01:00
Thomas Haller
fc870cf110 core: use nm_utils_get_monotonic_timestamp_s in nm-device-wifi (scheduled_scan_time)
https://bugzilla.gnome.org/show_bug.cgi?id=720833

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 19:51:45 +01:00
Thomas Haller
f50ca4aed1 core: use nm_utils_get_monotonic_timestamp_s in nm-supplicant-interface
https://bugzilla.gnome.org/show_bug.cgi?id=720833

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 19:51:45 +01:00
Thomas Haller
0535aa44db core: use nm_utils_get_monotonic_timestamp_s for timestamp of NMPlatformIP[46]Address
https://bugzilla.gnome.org/show_bug.cgi?id=720833

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 19:51:45 +01:00
Thomas Haller
fca51f3717 core: add nm_utils_get_monotonic_timestamp_* functions
https://bugzilla.gnome.org/show_bug.cgi?id=720833

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 19:51:45 +01:00
Thomas Haller
8eb9cfe0aa core/dhcp: fix dispose() of NMDHCPClient to handle multiple invocations
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 19:39:38 +01:00
Dan Winship
aa1b262091 tui: properly initialize the IP4 and IP6 settings on new connections
We need to initialize the methods.
2014-01-30 11:43:15 -05:00
Dan Winship
54dab9caf9 tui: fix a crash when creating a new connection
Make all the signals RUN_FIRST instead of RUN_LAST. In particular,
this fixes a crash when creating a new connection and activating the
listbox directly, in which case nmt_newt_listbox_activated() was
running after NmtAddConnection:create_connection() had already quit
the form and unrealized the listbox.
2014-01-30 11:43:15 -05:00
Dan Winship
7b85fb6f78 ifcfg-rh: write SLAVE=yes on bond slave connections
For compatibility with the old network scripts.
2014-01-30 11:16:44 -05:00
Thomas Haller
3bb54e2084 core: Merge branch 'th/ipv6-privacy'
This branch fixes two things:

- autoconf addresses were added with a /128 prefix, instead of the
  announced /64. This was done on purpose, to stop the kernel from
  adding a prefix route for the whole /64 net (in case, where RA
  has onlink=0). NM adds these routes himself.

- temporary addresses (ipv6-privacy, rfc4941) did not work at all
  ever since NM is doing router discouvery in user space.

Both features need help from kernel and libnl. If those versions
do not support the new address flags (IFA_F_MANAGETEMPADDR and
IFA_F_NOPREFIXROUTE), NM will log a message behave as before:
adding /128 autoconf addresses and not private addresses.

autoconf addresses as /64:
https://bugzilla.redhat.com/show_bug.cgi?id=1044590
https://bugzilla.redhat.com/show_bug.cgi?id=1045118

ipv6-privacy:
https://bugzilla.gnome.org/show_bug.cgi?id=705170
https://bugzilla.redhat.com/show_bug.cgi?id=1003859
https://bugzilla.redhat.com/show_bug.cgi?id=1047139

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 17:06:27 +01:00
Thomas Haller
1dea271469 core/rdisc: add support for IPv6 privacy
Add support for ipv6-private addresses. This feature
needs support from the kernel and libnl.

If there is no system support, temporary addresses are
not supported. Log a warning in this case.

Depending on whether ipv6-privacy (use_tempaddr) is enabled,
we add the address flag IFA_F_MANAGETEMPADDR and the kernel
will add temporary addresses for us.

https://bugzilla.gnome.org/show_bug.cgi?id=705170
https://bugzilla.redhat.com/show_bug.cgi?id=1003859
https://bugzilla.redhat.com/show_bug.cgi?id=1047139

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-30 17:04:36 +01:00
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