Commit Graph

8762 Commits

Author SHA1 Message Date
Pavel Šimerda
c43b7703cb netlink: fix rtnl_route_alloc_cache() call
Same fix as in commit 195a09d7c0.

NL_AUTO_PROVIDE is not a valid flag for this call and it's coincidental
with ROUTE_CACHE_CONTENT, which is not what we want.

One result arising from this fix is that per-device routes are now
assigned priorities correctly. This means, for instance, you can have a
wired and wireless connection on the same network, and have the wired
connection always take precedence whilst it's available.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2013-05-15 16:40:07 +02:00
Dan Williams
b9ea3ed1b1 build: don't install nm-dhcp-helper dbus permissions if we don't need to
The DHCP helper uses a private socket when building with dbus-glib >= 0.100,
which means we don't need to install a D-Bus permissions file.
2013-05-14 15:37:41 -05:00
Dan Williams
408cafc889 build: fix detection of Qt on non-Fedora platforms (bgo #691583)
Apparently Qt.pc is a Fedora-specific file to allow parallel install
of Qt3 and Qt4.  We should instead be using the upstream QtCore.

https://bugzilla.gnome.org/show_bug.cgi?id=691583
2013-05-14 14:50:32 -05:00
Dan Williams
bbf0720a8d trivial: remove a bit of debug code 2013-05-14 11:13:00 -05:00
Dan Williams
3a5bf0517c build: always generate docs at dist time (bgo #700093)
dist tarballs shouldn't ever be released without the documentation,
and this allows us to build the tarballs with pre-generated docs
that get installed on the end system, but don't need to be built
there.  So the end system doesn't need gtk-doc installed, only
the dist system does.

https://bugzilla.gnome.org/show_bug.cgi?id=700093
2013-05-14 10:53:46 -05:00
Dan Williams
f762fa58d6 ifupdown: recalculate unmanaged specs on interface change (debian #707070)
If a kernel interface changes its MAC address, and NM is not
supposed to manage that interface, ifupdown needs to notice
that MAC address change and tell NM that the unmanaged devices
have changed, so that NM continues to not touch the device
after the MAC has changed.
2013-05-14 10:45:48 -05:00
Dan Williams
a37051127e ifupdown: fix naming confusion in plugin hash tables
well_known_interfaces -> eni_ifaces, since it's a hash of any
interfaces read from /etc/network/interfaces.

well_known_ifaces -> kernel_ifaces, since it's a hash of any
network subsystem interface the kernel knows about
2013-05-14 10:45:46 -05:00
Dan Williams
b2c6709690 ifupdown: clarify name of connections hash
'iface_connections' is really the list of all NMIfupdownConnections
known to the plugin, read from /e/n/i and hashed by block name.  Since
ifupdown doesn't store anything *except* connections from /e/n/i,
just rename it to 'connections' to reduce confusion with the
well_known_interfaces and well_known_ifaces hashes.
2013-05-14 10:41:39 -05:00
Jiří Klimeš
1ca514581f man: minor cleanup in nmcli manual page (for 'nmcli device wimax list') 2013-05-14 10:16:59 +02:00
Dan Winship
43c4a45c4d devices: fix a bug in activation logic
It *is* legitimate to (re-)activate a connection on an already-active
device, so remove the newly-added "sanity check" preventing that.
Pointed out by jklimes.
2013-05-13 10:57:38 -04:00
Adrian Bunk
f5c29c9694 configure.ac cleanups
- unconditionally use AM_SILENT_RULES, automake 1.11 is already required
- remove the following macros whose results were unused:
  - AC_PROG_INSTALL
  - AC_HEADER_STDC
  - AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h syslog.h unistd.h)
  - AC_TYPE_MODE_T
  - AC_HEADER_TIME
  - AC_CHECK_FUNCS(select socket uname)
- remove the following obsolete macros (not relevant on non-historic systems):
  - AC_PROG_GCC_TRADITIONAL
  - AC_FUNC_MEMCMP

https://bugzilla.gnome.org/show_bug.cgi?id=700169
2013-05-13 10:29:37 -04:00
Dan Williams
448fd7c2aa wifi: only remove AP on link timeout if not found by supplicant
If for some reason the connection is disrupted and the AP rejects
reconnection attempts (perhaps the driver has a bug, you get
disconnected, and the AP rejects association because it thinks
you're already associated), the AP object was being removed from
the scan list by code meant to handle out-of-range or turned-off
APs.  Thus even though the AP was in-range, it wouldn't be
found and the connection retried until the next scan.

Instead, only remove the AP object from the scan list if the
supplicant hasn't been able to exchange any frames with the
AP.  This preserves the out-of-range handling, becuase the
supplicant wouldn't be able to talk to the AP and thus
'ssid_found' will be FALSE, and also ensures that an in-range
but confused AP says in the scan list and will be retried
immediately.
2013-05-11 08:09:28 -05:00
Pavel Šimerda
406a1912ca platform: fix NMFakePlatformLink handling 2013-05-10 22:31:06 +02:00
Pavel Šimerda
0ba6f32bce platform: add NMFakePlatformLink
This will help to store more link attributes in NMFakePlatform link
array than in public NMPlatformLink array. Some of the future
attributes will not be part of the NMPlatform API.
2013-05-10 21:41:27 +02:00
Pavel Šimerda
342134179c platform: return NULL type_name on failure 2013-05-10 21:41:27 +02:00
Jiří Klimeš
a453563bee cli: remove RUNNING field from default 'common' fields
That way it is not displayed by default:
$ nmcli general status

But can be explicitly requested:
$ nmcli -t -f running,version general status
$ nmcli -f all general status

E.g. Fedora initscripts do this in
/etc/sysconfig/network-scripts/network-functions

is_nm_running ()
{
    [ "$(LANG=C nmcli -t --fields running nm status 2>/dev/null)" = "running" ]
}
2013-05-10 12:28:01 +02:00
Dan Williams
6850dccd39 build: silence compiler warning about unused return value 2013-05-09 10:51:27 -05:00
Dan Winship
9008730f89 build: update gnome-code-coverage.m4
Update gnome-code-coverage.m4 from gnome-common to fix some (harmless)
error messages when coverage is disabled (bug 699943), and to add
support for lcov 1.10.
2013-05-09 09:19:08 -04:00
Mantas Mikulėnas
bdf2bfbc3c sleep-monitor: use more informative who/why text 2013-05-09 12:47:54 +02:00
Dan Winship
4e009ecaeb build: fix srcdir != builddir 2013-05-08 17:17:54 -04:00
Dan Winship
2a8023ef3d devices: fix the dbus glue naming inconsistency for NMDevice 2013-05-08 17:15:47 -04:00
Dan Winship
3ab82ea20e core: move devices into a subdirectory
We have lots of device types and will soon have lots more, so let's
put them in their own directory.
2013-05-08 15:07:22 -04:00
Dan Winship
c4417c71b6 core: use non-recursive build
Although having different parts of NM in different subdirectories
keeps the source tree neat, it has made the build messy, particularly
because of cross-dependencies between the subdirs.

Reorganize to build all of the pieces of the NetworkManager binary
from src/Makefile, and only use recursive make for test programs,
helper binaries, and plugins.

As part of this, get rid of all the per-directory convenience
libraries, and switch to building a single top-level
libNetworkManager.la, containing everything except main.c, which all
of the test programs can then link against.
2013-05-08 15:07:18 -04:00
Dan Williams
6c2a35a090 build: clean up old ModemManager defines
Make sure they don't conflict with ModemManager 0.7/0.8 defines from
libmm-glib.
2013-05-08 15:04:02 -04:00
Dan Winship
227b466178 build: stop using client-side generated dbus bindings
We removed these from libnm-glib last year, but there was still one
place where we were using them in the core.
2013-05-08 15:00:12 -04:00
Dan Winship
d529580cbb libnm-glib, core: use g_cclosure_marshal_generic
Since we depend on new glib now, we can just use the generic
marshaller rather than generating our own.
2013-05-08 14:59:29 -04:00
Dan Winship
ec0a66861e build: automate the -glue.h building rules 2013-05-08 14:59:29 -04:00
Dan Winship
6dc7f85ed9 platform: fix ethtool code
Need to initialize auto_g_free variables to NULL, in case we error out
before setting them to real values.
2013-05-08 11:24:50 -04:00
Aleksander Morgado
371f022116 build: fix reporting of modemmanager-1 compilation status
When --with-modem-manager-1=yes not explicitly specified (i.e. 'auto' mode), and
libmm-glib is not found, we should not report:
    Features:
      ...
      modemmanager-1: auto

Instead, better report:
    Features:
      ...
      modemmanager-1: no
2013-05-08 07:03:37 -05:00
Dan Williams
2940d2b3e2 libnm-glib: fix introspection for IPv6 DNS servers
Posix apparently isn't a GObject Introspection module...
2013-05-07 17:15:21 -05:00
Dan Williams
c2d81b9ea8 core: ensure missing IP config settings are treated as "auto" (bgo #699755)
Due to recent changes not all settings plugins send an IP config setting
when the method is 'auto'.  Some old code in the NMDevice IP config paths
mishandled this.  Fix that up; the expected behavior should be:

1) if the device is a slave, IP configuration is DISABLE/IGNORED
2) if the connection has an IP4 or IP6 setting, use the setting's method
3) default to AUTO
2013-05-07 15:58:11 -05:00
Dan Winship
7aefd5b5f4 platform: fix use of ethtool
The bits in the result of ETHTOOL_GFEATURES are not in any defined
order; you need to use ETHTOOL_GSTRINGS to get the names associated
with each bit to find what each one does. Fix
NMPlatformLinux:link_supports_vlans() to do this.

https://bugzilla.gnome.org/show_bug.cgi?id=699649
2013-05-07 16:47:34 -04:00
Jiří Klimeš
67eea30566 man: update nmcli manual page for 'nmcli connection add' 2013-05-07 19:41:37 +02:00
Jiří Klimeš
24f05292da cli: update bash-completion file for 'connection add'
* _nmcli_list vs. _nmcli_list_nl - space vs. new-line separated list
* connection add
  - various types, modes, mac, ifname, ...
2013-05-07 19:41:37 +02:00
Jiří Klimeš
6c2e7706af cli: 'connection add': accept multiple IP addresses 2013-05-07 19:41:37 +02:00
Jiří Klimeš
3901281077 cli: 'connection add' command for adding NM connections non-interactively
A few examples:
nmcli --ask connection add
nmcli connection add type ethernet
nmcli -p connection add type ethernet con-name "my ethernet connection 1"
nmcli connection add type ethernet ip4 192.168.100.5/24
nmcli connection add type ethernet ip4 192.168.100.100/24 gw4 192.168.100.1 ip4 1.2.3.4 ip6 abbe::cafe
nmcli connection add type ethernet ifname eth0
nmcli connection add type ethernet autoconnect no ifname eth0
nmcli connection add type wifi con-name Rakosnicek ssid Brcalnik
nmcli --ask connection add type wifi con-name My_WiFi
nmcli c a type infiniband con-name Infi1 transport-mode connected
nmcli c a type bluetooth addr 12:54:00:fd:db:26
nmcli c a type bluetooth addr 12:54:00:fd:db:26 bt-type dun-cdma
nmcli c a type gsm apn internet
nmcli c a type cdma
nmcli c a type bond
nmcli c a type bond ifname mybond0 mode active-backup
nmcli c a ifname maxipes-fik type vlan dev eth0 id 55
nmcli c a con-name VLAN1 type vlan dev eth0 id 44 ingress "2:4,3:55" egress "1:3" flags 6
nmcli c a type bridge ifname br0 stp on ip4 10.0.0.25
nmcli c a ifname eth0 type bridge-slave master 30fc816a-e7dd-4ae7-a86e-ab0c9cee51c2 hairpin no path-cost 333 priority 20
nmcli c a type bridge-slave master br2
2013-05-07 19:41:36 +02:00
Jiří Klimeš
5761a46da0 cli: add functions for creating NM address and route structures to common.c
nmc_parse_and_build_ip[4|6]_address() creating NMIP[4|6]Address
nmc_parse_and_build_ip[4|6]_route() creating NMIP[4|6]Route
2013-05-07 19:41:36 +02:00
Jiří Klimeš
04d590a923 cli: nmc_string_to_bool() - util function for converting string to boolean
["true", "yes", "on"] -> TRUE
["false", "no", "off"] -> FALSE
2013-05-07 19:41:36 +02:00
Jiří Klimeš
ddd3ea2cd4 cli: util functions for converting string to int
nmc_string_to_int()  - converts string to signed long int (decimal)
nmc_string_to_uint() - converts string to unsigned long int (decimal)
nmc_string_to_int_base()  - converts string to signed long int with given base
nmc_string_to_uint_base() - converts string to unsigned long int with given base
2013-05-07 19:41:36 +02:00
Jiří Klimeš
8598ee1139 cli: nmc_string_is_valid() utility function
This function checks whether a string is contained among allowed strings. It
performs case-insensitive comparison and supports shortcuts if they are unique.
It returns a pointer to the found string in allowed array, or NULL.
2013-05-07 19:41:36 +02:00
Jiří Klimeš
ced61dfc7f libnm-util: add access functions for 'mac-address-blacklist' to wired/wireless
nm_setting_wire(d/less)_get_num_mac_blacklist_items()
nm_setting_wire(d/less)_get_mac_blacklist_item()
nm_setting_wire(d/less)_add_mac_blacklist_item()
nm_setting_wire(d/less)_remove_mac_blacklist_item()
2013-05-07 19:38:31 +02:00
Dan Winship
440223fa3c cli: sort the output of "nmcli dev"
Sort the output of "nmcli dev", first by state (with connected devices
first and unmanaged ones last), then by type and interface name.
2013-05-07 12:46:56 -04:00
Dan Winship
ae9a389f83 libnm-glib, cli: add nm_device_get_type_description
Add a new libnm-glib method to get the type description for a device,
and use it in nmcli. For most types, the type description is based on
the class name, but for NMDeviceGeneric, it comes from the
:type-description property.
2013-05-07 12:46:56 -04:00
Dan Winship
4819df28b4 core: add NMDeviceGeneric:type-description
Use nm_platform_link_get_type_name() to get information about the
generic device, and export that via D-Bus
2013-05-07 12:46:56 -04:00
Dan Winship
be5ef71ab0 platform: add nm_platform_link_get_type_name()
Add a platform method to return the name of the link type. (Eg,
"ethernet", "loopback", "tun")
2013-05-07 12:46:56 -04:00
Dan Winship
ce4f2a4bd6 core, libnm-glib: add NMDeviceGeneric
Add NMDeviceGeneric, to provide generic support for unknown device
types, and create NMDeviceGenerics for those devices that NM
previously was ignoring. Allow NMSettingGeneric connections to be
activated on (managed) NMDeviceGenerics.
2013-05-07 12:46:56 -04:00
Dan Winship
8b823d7c6a libnm-util: add NMSettingGeneric
Add NMSettingGeneric, a dummy L2 NMSetting for creating NMConnections
for devices that are not specifically recognized.
2013-05-07 12:46:56 -04:00
Dan Winship
2226a00cc2 core: add a "default-unmanaged" setting for devices
Allow devices to declare themselves unmanaged-by-default, but tweak
nm-manager and nm-policy to allow activating matching connections on
those devices anyway.

(This ensures that NM keeps its hands completely off the device unless
the user explicitly asks it to do something with it.)
2013-05-07 12:46:56 -04:00
Dan Winship
ab7ebead2c core: add IP configuration for unmanaged devices
Use NMPlatform to read the IP address/route configuration of unmanaged
devices, and export that via D-Bus like we do with NM-generated IP
configs.
2013-05-07 12:46:55 -04:00
Jiří Klimeš
669fdf9131 man: add a few pieces of metadata to silence DocBook warnings in manpages
and correct "SEE ALSO"
2013-05-07 10:07:57 +02:00