Commit Graph

8762 Commits

Author SHA1 Message Date
Dan Williams
bc50a2a75b cli: add VLAN device support 2012-03-07 11:45:40 -06:00
Dan Williams
c02702e574 libnm-glib: add NMDeviceVlan
And fix a small bug with bond devices too if their device type
isnt' set at construction time.
2012-03-07 11:45:25 -06:00
Dan Williams
dc6341acec vlan: try harder to get carrier state at device creation time
The carrier signal might be delayed a bit, so if we're creating
the device as a result of activating a connection, make sure the
carrier is up-to-date so we can proceed with activation.
2012-03-07 10:15:30 -06:00
Jiří Klimeš
84403ab84a wifi: fix entering an endless loop 2012-03-07 15:31:19 +01:00
Jiří Klimeš
79757f10f3 ifcfg-rh: use single quotes when quoting WPA passphrases (WPA_PSK) (rh #798102)
Single quotes ensure we don't break initscripts (bash processing) when the
string contains special characters. Special handling is necessary for single
quotes characters. They have to be escaped and the whole string has to be
prepended with '$' character so that bash is happy.
This change also filters out CR and LF characters as they break WPA_PSK
variable and could pose security issues.
2012-03-07 14:45:37 +01:00
Dan Winship
49214066a4 Fix capitalization of "InfiniBand"
"InfiniBand" has a capital "B". Fix that everywhere it's being used as
a human-readable string.

In particular, the RH initscripts recognize "TYPE=infiniband" and
"TYPE=InfiniBand", but not "TYPE=Infiniband", which is what we were
writing before.
2012-03-06 13:23:29 -05:00
Dan Williams
4fc8b8ccd0 cli: don't require a device for virtual connections
They may not have had their devices created yet, and the activation
process creates the device, so allow NULL device paths for
activation.
2012-03-06 12:01:49 -06:00
Dan Williams
11da5fb6bc core: handle NULL device path for activation
For virtual interfaces and other cases we won't necessarily have
a device path, which means clients will be passing "/" instead.
Fix that up the same way we fix up the specific object.
2012-03-06 12:00:41 -06:00
Dan Williams
3567e6f9ea core: remove some redundant code and add some argument checks
ifindex is already passed to the function, no need to look it
up again.
2012-03-06 11:38:03 -06:00
Dan Williams
cd2c721762 core: use a second startup pass to detect all VLAN interfaces
We can't guarantee the ordering of devices that udev sends to us
on startup.  Thus, a VLAN interface could be sent before its
parent is, and we won't be able to find the parent in the device
list.  But that's fine; all parents will be detected during the
first pass, and we silently fail the VLAN interface.  Then we
do a second pass where any remaining VLAN interfaces will be
created because we found the parents during the first pass.
2012-03-06 11:07:15 -06:00
Dan Williams
8c3ac9bdd8 trivial: s/master/parent for VLAN interface info function 2012-03-06 11:07:15 -06:00
Jiří Klimeš
96a2bc43af cli: add a new reason code -> string mapping 2012-03-06 11:39:11 +01:00
Jiří Klimeš
78f09078f1 cli: add Bond device support 2012-03-06 11:31:03 +01:00
Dan Williams
723bab41ea ifcfg-rh: remove duplicate tests 2012-03-06 00:36:55 -06:00
Dan Williams
0d2aac2021 wifi: remove unused nl80211 attributes that break build on older kernels 2012-03-06 00:38:57 -06:00
Dan Williams
9296fd1ad0 docs: add Infiniband, VLAN, and Bond settings to API specs 2012-03-06 00:38:38 -06:00
Dan Winship
51f2bd0198 ifcfg-rh: don't write out a fake minimal IP4 config for bond slaves
The writer had code to fake up a simple IP4 config if the connection
didn't already have one. Make sure we don't do that in the bond case.
2012-03-05 15:55:43 -05:00
Dan Winship
6c38f0cfd1 libnm-glib: add NMDeviceBond
it exists on the server/D-Bus side, so it should exist in libnm-glib too
2012-03-05 15:55:43 -05:00
Dan Williams
a6809b0253 ip6: set binary NL address prefix too
There's both nl_addr_set_prefixlen() to set the binary address's
prefix length and rtnl_addr_set_prefixlen() to set the container
RTNL address's prefix length.  When the addresses come in from
the kernel these are the same, but when sending addresses to
the kernel, NM wasn't setting them to the same thing.  Do that,
since apparently libnl wants that when matching addresses in
nm-system.c:sync_addresses() here:

	if (addrs[i] && nl_object_identical (match, (struct nl_object *) addrs[i]))
		break;

otherwise the kernel addres (match) doesn't match the NM-derived
address (addrs[i]) that we got from the IP6Manager when reading
back kernel IPv6 addresses in response to netlink events.
2012-03-05 10:28:18 -06:00
Dan Williams
a9c3fe021a ip6: print out prefix in some debug messages 2012-03-05 10:28:17 -06:00
Jiří Klimeš
74d962e8c4 trivial: spacing fix 2012-03-05 13:19:47 +01:00
Jiří Klimeš
5519ff9952 cli: add 'vlan' setting 2012-03-05 09:52:10 +01:00
Jiří Klimeš
71e7434d1a cli: add 'bond' setting 2012-03-05 09:52:03 +01:00
Dan Williams
5cd9b1e22f wifi: don't remove APs still known to the supplicant
Because the supplicant doesn't have a BSS property for "last seen"
we have to fake that by listening to PropertiesChanged events for
stuff like signal strength, which usually changes a bit from scan
to scan.  But in case it doesn't change, we'll never get that PC
signal, and thus we'll never update our internal 'last seen'
timestamp, and thus the AP will get removed from the NM scan list
even if it was in the supplicant's last scan results.

So, if the AP if we haven't receieved a BssRemoved signal for the
AP yet don't remove it from the NM scan list.  One caveat is that
if the supplicant's DEFAULT_BSS_EXPIRATION_AGE value is greater
than NM's AP expiration age, NM will by consequence use the
supplicant's value instead.  At the moment the supplicant sets
DEFAULT_BSS_EXPIRATION_AGE to 180 seconds while NM's is 360.
2012-03-02 18:17:34 -06:00
Dan Winship
fb06cda723 libnm-util: fix two bugs in nm_setting_bond_get_option()
The function documents that it returns FALSE if idx is out of range,
so don't g_return_val_if_fail() in that case.

Also, free the return value from g_hash_table_get_keys().
2012-03-02 14:20:55 -05:00
Jiří Klimeš
501a389a19 cli: enable OLPC device now that we have it in libnm-glib 2012-03-02 09:02:33 +01:00
Jiří Klimeš
960621c400 vlan: add missing includes 2012-03-02 08:56:46 +01:00
Dan Williams
3efd156f50 release: bump version to 0.9.3.995 (0.9.4-beta1) 2012-03-01 18:05:28 -06:00
Dan Williams
e0613ac67c release: update NEWS 2012-03-01 18:02:13 -06:00
Jiri Popelka
128695c447 firewall-manager: changing the zone an interface belongs to
When we want to change the zone an interface belongs to
we can't use firewalld's addInterface() because this one
doesn't allow to add interface to zone when it already
has been part of some other/same zone.
We need to use changeZone() method instead - hopefuly
this is the final name of this method.
2012-03-01 18:02:00 -06:00
Jiri Popelka
b2d4f66dd3 firewall-manager: add interfaces to zones after firewall (re)start
Because firewalld has no idea what interface is part of which zone
we need to inform it after it (re)starts what interface belongs to which
zone.
2012-03-01 18:01:56 -06:00
Mathieu Trudel-Lapierre
86a8fa4a79 dns: dnsmasq plugin: update command-line parameters for starting dnsmasq
Drop --strict-order; dnsmasq is intelligent enough to ask nameservers in
an order that makes the best of possibly slow nameservers (or broken ones),
and interrogating them in strict order breaks this.

Add --no-hosts: by default dnsmasq will read /etc/hosts as a list of things
to resolve statically; this is something we want to avoid as nsswitch.conf
already lists files as the first data store to look at; where the entries
in /etc/hosts will already have been returned if that's what the user wants
to see. If the /etc/hosts file then changes, dnsmasq would have to be restarted
before the user would get the new value resolved externally. Avoid this, let
/etc/hosts override DNS entries normally through the resolver and show
changes as soon as the file is updated.
2012-03-01 18:00:03 -06:00
Dan Williams
84ef2acdd0 bond: set bond device options during activation 2012-03-01 17:40:18 -06:00
Dan Williams
b3f7b20a99 core: set unspecified bond options to their default value
Otherwise if another connection was subsequently activated on a
bond interface, and didn't specify all options, ones set for the
previous connection could stay set for the new connection.
2012-03-01 17:40:18 -06:00
Dan Williams
b9ddbe58f0 libnm-util: add functions for getting valid bond options and defaults
Since the options are a hash table now there wasn't any way to
determine what options were allowed and what their default values
are.  Add some functions to do that.
2012-03-01 17:40:18 -06:00
Dan Williams
33d0cff3e4 core: use active connection dependency master instead of manually setting it
We already have the master device kept in the active connection, so
we can just use that instead of having the Policy determine and set
it manually.  This also should allow slaves to auto-activate their
master connections if the master is able to activate.
2012-03-01 17:40:18 -06:00
Dan Williams
9146d4e8c6 core: move slave handling to device subclasses
Let the master control how the slave gets enslaved and released
since that's dependent on the virtual interface type of the master.
2012-03-01 17:40:17 -06:00
Dan Williams
58227d0136 wired: check carrier immediately after bringing device up
Virtual devices that we might create when their slave is started
(like bonds) have a virtual carrier that often isn't set on when
until the device is brought up.  The device is brought up during
creation, but the initial carrier check happens before the device
is up, so the initial carrier state from the constructor isn't
quite accurate in some cases.

Since we want to use virtual interfaces that we create right after
we create them, we want them to be available too, and that usually
requires the carrier to be on.  So recheck the carrier right after
bringing the interface up, so that the carrier state is accurate
immediately after the device is created.
2012-03-01 17:40:17 -06:00
Dan Williams
28edd78f89 core: don't require an error argument to nm_device_check_connection_compatible() 2012-03-01 17:40:17 -06:00
Dan Williams
db94e37eb5 core: wait for dependencies before continuing with device activation
Before jumping to activation stage 1, make sure dependencies are activated.
2012-03-01 17:40:17 -06:00
Dan Williams
0b8ff52fdd core: track active connection dependencies
Track a master active connection and emit wait/ready/fail when
it changes state.  This signal is intended for devices to
delay their activation until a master device is ready.
2012-03-01 17:40:17 -06:00
Dan Williams
d08b33bb01 core: ensure master connections are available for dependence
If the connection requires a master connection or master device,
find that connection, and activate it if it's not already
activated.
2012-03-01 17:40:17 -06:00
Dan Williams
0eb09bc99b core: don't assert in nm_device_get_connection()
This function used to be used only from activation paths, so it
was fine to assert there because we always expected that there
would be an activation request.  These days we'd like to use it
in more places, so just return NULL if there's no connection.
2012-03-01 17:40:17 -06:00
Dan Williams
fbfdecf380 core: reorganize activation flow by splitting out VPN activation work
Just split the VPN-specific stuff out to its own function so that
nm_manager_activate_connection() isn't so large.
2012-03-01 17:40:17 -06:00
Dan Williams
7aa2a8271d core: use NMActiveConnection objects throughout activation paths
They are the basic class that tracks active connections, and we're
going to use them for connection dependencies.  So use the fact that
both NMVPNConnection and NMActRequest have the same base class
instead of using object paths.
2012-03-01 17:40:17 -06:00
Dan Williams
65a13f9d8a core: convert VLAN interfaces to a device subclass
Many different interface types can support VLANs, including
Infiniband, WiFi, etc.  So we have to create a new device class
for them instead of keeping the support in NMDeviceEthernet.
2012-03-01 17:40:17 -06:00
Dan Williams
5ee7841475 core: extend nm_device_hwaddr_matches() to match specific addresses
We'll want to eventually match (for VLAN) a given hardware address
that's not the device's hardware address.  Only the device itself
knows which NMSetting should contain it's hardware address (ie
the 'wired' setting for NMDeviceEthernet, 'infiniband' for
NMDeviceInfiniband, etc) and VLANs take their hardware address
from the parent interface.  So eventually we'll have VLAN
interfaces use these new arguments to ask their parent interface
to match the VLAN hardware address in a connection, since the
VLAN doesn't know (or need to know) what kind of interface it
really is underneath.
2012-03-01 17:40:17 -06:00
Dan Williams
29672c3f7d core: move IP config matching to NMDevice superclass
It's useful for more than just NMDeviceWired and subclasses.
2012-03-01 17:40:17 -06:00
Dan Williams
57b77b10b6 core: fix parent/master confusion in some argument names
It's the parent, not the master, that we care about here.
2012-03-01 17:40:17 -06:00
Dan Williams
51edc6ae97 core: use VLAN parent instead of master for creating the virtual interface
The 'parent' property of NMSettingVlan is now what describes the
interface from which the VLAN gets created, not master.
2012-03-01 17:40:17 -06:00