Commit Graph

7740 Commits

Author SHA1 Message Date
Dan Williams
7ee3abe19b ip6: suppress merge_ip6_configs() warning
NetworkManager[815]: merge_ip6_configs: assertion `src != NULL' failed

Calling ip6_config_merge_and_apply() with a NULL src_config is fine
since that's what happens during RA or DHCP lease changes.

Reported by Johannes Sjölund
2011-12-01 16:19:24 -06:00
Dan Williams
fc7941032f ip6: ensure IPv6 failures take precedence over success
The RDNSS and DNSSL failure cases wouldn't clear out the idle
handler of a previous success (if that success hadn't fired yet);
it seems pointless to signal success and then immediately fail.
Second, it would cause a dangling GSource if the device was
removed or NM quit at the right time.
2011-12-01 16:11:04 -06:00
Gary Ching-Pang Lin
4e1abb8315 core: check the iface index correctly
If the iface name is invalid, the index is -1.
2011-11-30 18:05:51 -06:00
Marek Černocký
b9ceba6133 cz: update Czech translation (bgo #664736) 2011-11-30 15:56:32 +01:00
Jiří Klimeš
77ef5e8676 examples: add a few examples in ruby 2011-11-29 16:20:04 +01:00
Jiří Klimeš
576acdd2bf libnm-glib: get access points in constructor to prevent D-Bus errors
The errors appeared due to calling GetAccessPoints() on removed devices:
nm_device_wifi_get_access_points: error getting access points: Method "GetAccessPoints" with signature "" on interface "org.freedesktop.NetworkManager.Device.Wireless" doesn't exist
2011-11-24 17:15:39 +01:00
Jiří Klimeš
42060fdd89 libnm-glib: get devices and their properties in constructor (NMClient, NMDevice)
NMClient and NMDevice used a 'lazy' approach for getting stuff from D-Bus, i.e.
requesting data from NM when they are asked for. However, for some cases, like
removing devices it is not optimal. libnm-glib will never see a device that was
removed, but not added during NMClient's lifetime.

So let's get devices list in NMClient's constructor and device properties
in NMDevice constructor to have the data from the beginning.
2011-11-24 17:15:36 +01:00
Jiří Klimeš
43b3466b14 libnm-glib: fix demarshalling of ActiveConnection property in NMDevice 2011-11-24 14:11:52 +01:00
Jiří Klimeš
0dc11be8da trivial: remove unnecessary always-true check 2011-11-22 09:52:42 +01:00
Evan Broder
9fc134ee83 keyfile: Read and write the new 8021x.password-raw field 2011-11-21 23:51:01 -06:00
Evan Broder
b08e2b8932 supplicant: If password field is empty, check password-raw 2011-11-21 23:50:54 -06:00
Evan Broder
dc92d1258d settings: Add new password-raw and password-raw-flags properties to 8021x.
In cases where the actual password is non-ASCII, it may not be
possible to deliver the 802.1x password as a D-Bus string. Instead
provide an alternate field holding the password as a byte array.

In cases where both a password and password-raw are supplied,
password is preferred.
2011-11-21 23:50:48 -06:00
Evan Broder
2c484fbc77 supplicant: Validate password as a UTF-8 string, not a byte array
The 802.1x password for MS-CHAPv2 can be up to 256 UCS-2 characters,
so we need to validate the password as UTF-8 to make sure we don't
reject valid passwords containing non-ASCII characters
2011-11-21 23:50:46 -06:00
Evan Broder
ef9551bcf3 supplicant: Add a new validation type for UTF-8 strings 2011-11-21 23:50:43 -06:00
Thomas Graf
6346bd60be bonding: wait for master connection to be available
Currently slaves only wait for the master device to be present. This is
insufficient, we want to wait for the master connection to be activated.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-21 23:41:36 -06:00
Weiping Pan
0ec51387c0 netlink: use correct preprocessor if format
I only install libnl-3.2.3 on my system, and I met an error:

In file included from ../../src/nm-netlink-monitor.h:93:0,
from nm-vpn-connection.c:48:
../../src/nm-netlink-compat.h:210:5: error: "HAVE_LIBNL1" is not defined
../../src/nm-netlink-compat.h:210:20: error: "HAVE_LIBNL2" is not defined
make[5]: *** [libvpn_manager_la-nm-vpn-connection.lo] Error 1

Signed-off-by: Weiping Pan <wpan@redhat.com>
2011-11-21 15:33:58 -06:00
Matej Urbančič
3ea9ce66c2 sl: update Slovenian translation (bgo #664372) 2011-11-21 10:30:50 +01:00
Dan Williams
e8c6fa8755 trivial: fix wrong return type 2011-11-17 19:04:15 -06:00
Dan Williams
2ea0f3e9c2 backends: clean them up somewhat
Put the two functions they provide into their own header so
places that need them don't have to include nm-system.h.
2011-11-17 18:55:07 -06:00
Dan Williams
9dd270966e ifcfg-rh: revert some bits of a2b1afb1e4
Revert the DEVICE and suffix bits for the connection name; there's
a few problems with this.  It adds the DEVICE value for connections
regardless of what type they, even in cases where it's not hugely
useful (ie basic wired).  We used to do this, but stopped doing it
because it has zero relevance to a large number of users.  Instead,
the UI itself should do this where appropriate.  That probably means
that 'nmcli' and other tools should give more information about
the components of a connection (like a slave device's master) and
GUI tools would show that in detailed connection information but
not in the at-a-glance status or tooltips.  Second, if more
more advanced users wish this information to show up in the name
they can always set the name themselves, or name the ifcfg file
something like "ifcfg-bond1-slave-of-eth0" too.
2011-11-17 18:05:35 -06:00
Evan Broder
9f86b44a52 ifupdown: fix build 2011-11-17 16:24:56 -06:00
Dan Winship
2510c617ec libnm-util: add ether_ntoa/ether_aton-like utility methods
nm_utils_hwaddr_ntoa() and nm_utils_hwaddr_aton() are like
ether_ntoa()/ether_aton(), but handle IPoIB too.

nm_utils_hwaddr_atoba() is like _aton() but returns a GByteArray,
since that's what's wanted in many places.

Also remove nm_ether_ntop() and replace uses of it with
nm_utils_hwaddr_ntoa().
2011-11-17 13:37:08 -06:00
Dan Winship
3dcfd305d6 trivial: three small obvious fixes 2011-11-17 13:25:14 -06:00
Jiří Klimeš
7b7e426b65 settings: pass config file name to settings plugins
Thus plugins will use the correct configuration file, even in case the name
is specified on command line with --config.
2011-11-16 08:56:29 +01:00
Jiří Klimeš
2106d94d08 settings: send agent-owned secrets also for newly created connections
We have to send agent-owned secrets to agents via SaveSecrets() D-Bus call for
newly created connections, the same way we do for connection updates.
Without the change secrets aren't saved for new created VPN connections,
only after a connection update.
2011-11-15 13:43:46 +01:00
Thomas Graf
8509e45f31 wimax: include $(LIBNL_CFLAGS) in CFLAGS because nm-device-wimax.c needs nm-system.c
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-14 18:43:25 -06:00
Thomas Graf
9b05037c44 nl80211: use genl_ctrl_resolve()
Based on a patch for iw by Johannes Berg <johannes.berg@intel.com>

This simplifies the code quite a bit since we don't need
an nl_cache or nl_family anymore.

genl_ctrl_resolve() is available in libnl1.1, libnl2 and libnl3.

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-14 18:42:49 -06:00
Thomas Graf
a2b1afb1e4 bonding: prefix bonding connections with "Bond" and append slave suffix
Moves the logic of naming connections into its own function. Allows each
connection type to provide a "hard" prefix which will always be used.
Bonding uses this to prefix all bonding connections with "Bond".

If a DEVICE= line is available, append it to the end of connection name
for easier identification of the real device behind it.

Appends the suffix "[slave-of <MASTER>]" to all connections which are
configured as a slave of a bond.

Examples:

  myName                  -> myName (eth0)
  System eth0             -> System eth0
  myName2                 -> Bond myName2 (bond0)
  System bond0            -> Bond bond0
  myName                  -> myName (eth0) [slave-of bond0]
  System eth0             -> System eth0 [slave-of bond0]

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-14 18:37:37 -06:00
Thomas Graf
914b28a626 nl80211: check and link against LIBNL_GENL3
Allows using nl80211 with libnl3

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-14 17:40:10 -06:00
Thomas Bechtold
e8051a9b6f modem: map modemmanager errors more detailed
* add 4 new NMDeviceStateReason to map ModemManager errors more detailed
* fix wrong error mapping for MM_MODEM_CONNECT_ERROR_NO_DIALTONE
2011-11-14 17:31:40 -06:00
Thomas Graf
be2e40c667 build: add "cscope" target to makefile
It builds cscope database, gets cleaned on "clean".
2011-11-14 13:40:28 +01:00
Thomas Graf
85f49630af trivial: update .gitignore to be nice to vim 2011-11-14 13:27:55 +01:00
Dan Williams
2db6295b42 wifi: only lock connection to device for non-locally-administered addresses
If the device's permanent MAC address is 'locally administered'
(ie, first byte | 0x02 != 0) then we don't want to lock the
connection to the device because it's likely a device that changes
it's MAC every hotplug due to driver bugs or the fact that some
devices don't store their MAC in EEPROM anyway.
2011-11-10 14:47:19 -06:00
Dan Williams
e630b638a8 core: ensure slave devices advance to ACTIVATED state
If the interface has no IP configuration (bond slave, etc) then
it still needs to get activated too.  Previously the code would
only move to ACTIVATED when the first IP method completed, but
since slaves don't do IP config, they never got to ACTIVATED
state.
2011-11-10 11:11:43 -06:00
Dan Williams
9c0bfd0d03 release: update NEWS 2011-11-09 23:50:29 -06:00
Dan Williams
c15dea298f core: make testcases work after bonding merge 2011-11-09 23:40:04 -06:00
Thomas Graf
3ef7bca6fa bonding: apply bonding settings when setting up bonding device
Adds a new function nm_system_apply_bonding_config() which applies
the parameters specified in the NMSettingBond object via sysfs.

Calls that function after creating/updating the bonding master
device.

If a parameter is not specified in the ifcfg the parameter will be
re-initialized to the default value. This may overwrite changes
which have been done manually via sysfs but it is the only reliable
way of setting up the bond.

Supported parameters for now:
 - mode (default: balance-rr)
 - miimon (default: 100)
 - updelay (default: 0)
 - downdelay (default: 0)
 - arp_interval (default: 0)
 - arp_ip_target (default: none)

Thomas Graf <tgraf@redhat.com>
2011-11-09 23:24:04 -06:00
Thomas Graf
d839e1c817 core: convert nm_system_get_link_type() to return an int
Kills the strdup() and avoids having the caller free the memory. Also renames
the function to nm_system_get_iface_type() since "link" is not a common term
in NM.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:24:04 -06:00
Thomas Graf
e654bb8d1d netlink: Fix #if check if HAVE_LIBNL1 and HAVE_LIBNL2 are not defined
Need to use #if defined HAVE_LIBNL1 instead of #if HAVE_LIBNL1.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:24:04 -06:00
Thomas Graf
ae22fffe23 bonding: don't fall back to DHCP if IP config is missing
If the IP config is missing, we just don't do any IP config, instead
of treating it as DHCP as happens for all other interface types.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:24:04 -06:00
Thomas Graf
b496355b2a bonding: enslave/release bonding slaves in activation/deactivation
Code is written generic enough to allow easy addition of further master/slave
relationships such as bridging relations.

Signed-off-by: Thomas Graf <tgraf@redhat.com>

(whitespace cleanups and libnl compat by dcbw)
2011-11-09 23:24:04 -06:00
Thomas Graf
a65028a025 bonding: postpone auto-activation of a slave until master is present
For a slave to be activatetable the master connection must be present.
Activation of the slave is postponed until this condition is met.

Once the slave is being activated, a reference to the master connection
is acquired and held for the lifetime of the bond.

Changes v2:
 - Made check_master_dependency() return TRUE/FALSE

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:24:04 -06:00
Thomas Graf
6349151de1 bonding: implement bonding slaves
Adds a MASTER= directive to ifcfg-rh allowing a connection to define
itself as bonding slave.

Adds a connection property "master" which contains the in-kernel device
name or UUID of the master connection.

Adds a connection property "slave-type" which defines the type of slave
this connection represents. Currently this is only set by bonding but
eventually this will be used by VLAN and bridging.

Enforces that no bonding slave connection has any IPv4 or IPv6
configuration set.

Changes make_ip4_setting() to take a universal flag indicating whether
to allow disabling ip4 config or not and use it for both, ip6 and
bonding special case.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:23:21 -06:00
Thomas Graf
8d5af59812 bonding: detect virtual bonding devices and create an ethernet device
A bonding device is like a virtual ethernet device. We therefore reuse
nm-device-ethernet and add some special handling to detect bonding
connections.

Changes v2:
 - Fixed memory leak

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:16:31 -06:00
Thomas Graf
095aff0c21 bonding: kernel bonding device creation
Creates virtual kernel devices as needed. Since the manager is
initialized after the connections have been loaded no
CONNECTIONS_ADDED notification is received for connections parsed
at startup.

Therefore walks the loaded connections looking for bonding
connections.

Connections added on the fly are handled via the notifications.

Connection renaming and deleting is not supported yet.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:16:31 -06:00
Thomas Graf
a2a0d78818 bonding: settings parser for ifcfg plugin + NMSettingBond class
Introduced a new TYPE=bond for ifcfg-rh configuration files.
Alternatively BONDING_MASTER=yes can be specified instead of
setting the type explicitely to maintain backwards compatibility
with existing configuration files.

Bonding device files require a DEVICE= line to be present which
specifies the virtual bonding interface in the kernel. We do not
allow auto-generation of the name in order to keep confusion to
a minimum when reusing existing bonding interfaces.

The BONDING_OPTS= parameter can be used to specify various bonding
related options, such as:
  - mode
  - miimon
  - updelay
  - downdelay
  - arp_interval
  - arp_ip_target

By default, the NMSettingBond class uses a miimon value of 100 which
seems like a sensible default value for 99% of all configurations.
If this is not suitable, an arp_ip_target needs to be specified
manually.

A writer is not yet implemented.

Changes v2:
 - renamed DeviceName property to InterfaceName
 - moved code to validate device name to dev_valid_name() for future use

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:16:31 -06:00
Dan Williams
d0b71957e7 firewall: remove nm-firewall-types.h
No need for it.
2011-11-09 23:11:34 -06:00
Dan Williams
cf7ec0e63e firewall: cleanups and code consolidation
Consolidate the NMDevice firewall add code so that firewall
handling is done in one place.
2011-11-09 23:11:34 -06:00
Dan Williams
bc628da16b libnm-util: fix up connection diff test 2011-11-09 22:06:36 -06:00
Dan Williams
40fc428f9f libnm-util: fix up symbol visibility test for zones 2011-11-09 22:06:36 -06:00