Commit Graph

8762 Commits

Author SHA1 Message Date
Dan Williams
20483d65ae core: add nm_ip4_config_address_exists() and nm_ip6_config_address_exists() 2013-11-08 16:46:44 -06:00
Dan Williams
afcc4f2a25 core: read gateway when capturing IP configs 2013-11-08 16:46:44 -06:00
Dan Williams
048052cb6e dhcp: make dhclient lease parsing code testable 2013-11-08 16:46:43 -06:00
Dan Williams
11e17856c9 dhclient: fill IPv4 config more completely when reading lease files 2013-11-08 16:46:43 -06:00
Dan Williams
15f9a27d2e platform: clarify that address lifetimes are in seconds 2013-11-08 16:46:43 -06:00
Dan Williams
f7645f4ab4 dhclient: simplify lease expiration checking
Use GDateTime instead of open-coding it.
2013-11-08 16:46:43 -06:00
Dan Williams
e2fa51cd67 dhcp: rename get_lease_config -> get_lease_ip_configs
Since dhcpcd doesn't implement this function yet, just remove the
stub implementation.
2013-11-08 16:46:43 -06:00
Pavel Šimerda
21b6f34f5e platform: avoid one bug warning 2013-11-08 16:46:43 -06:00
Pavel Šimerda
10f9b6c58b core: support slave devices in nm_platform_generate_connection()
Ask each device class to update the slave configuration for their
type of slave.
2013-11-08 16:46:43 -06:00
Dan Williams
60b88d526c core: slaves should have empty captured IP configuration 2013-11-08 16:46:43 -06:00
Dan Williams
b54a9868fd core: clean up legacy connection matching; remove match_l2_config
All previous users of this API are gone, so remove it.
2013-11-08 16:46:22 -06:00
Dan Williams
ab586236e3 core: implement update_connection() for Team 2013-11-08 16:35:18 -06:00
Dan Williams
1609b32dd9 core: implement update_connection() for Infiniband
FIXME: implement partition support
2013-11-08 16:34:57 -06:00
Dan Williams
0626fe37d0 core: implement update_connection() for Generic devices
tun/tap, macvlan, and GRE devices may be bridge, bond, or team slaves
and should get that configuration detected at startup.
2013-11-08 16:38:49 -06:00
Pavel Šimerda
142bca6504 core: implement update_connection() for VLANs 2013-11-08 16:38:49 -06:00
Pavel Šimerda
c90730fa43 core: implement update_connection() for bonds 2013-11-08 16:38:49 -06:00
Pavel Šimerda
a3af5cfe9d core: implement update_connection() for bridging 2013-11-08 16:38:48 -06:00
Dan Williams
12fb2519af core: add nm_connection_provider_get_connection_by_uuid() 2013-11-08 16:38:48 -06:00
Dan Williams
c23e1bbb44 ifcfg-rh: don't crash when in-memory-only connections don't have paths
If the connection has never been saved to disk, it won't have a path yet,
but that doesn't mean we should crash.  Next, when reloading connections,
only try to do connection matching on connections that have paths, otherwise
all in-memory-only connections would be removed at the end of
read_connections().
2013-11-08 16:38:48 -06:00
Dan Williams
6b6265ebeb team: fix possible crash by ensuring teamd context is cleared
teamd_cleanup() might get called multiple times, and since the rest
of the function is safe against multi-calls, make priv->tdc safe
against being called again too.
2013-11-08 15:35:48 -06:00
Thomas Haller
788eed99de core: workaround crash when connecting to wifi (rh #1025371)
rh #1025371 reports a crash in handle_ip_config_timeout() because
nm_device_wifi_get_activation_ap() did not return any access point.

The handling of the AP in nm-device-wifi.c should be reworked and soon
will be fixed. For now, play it safe, and try to cope with any cases
where nm_device_wifi_get_activation_ap() might return NULL.

Later, this patch should be reverted and handling of the AP properly
cleaned up.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-08 18:11:50 +01:00
Dan Winship
3de7ede146 trivial: fix a comment cut-and-paste-o 2013-11-08 08:27:30 -05:00
Thomas Haller
ec1cabde28 core: fix error in print_vpn_config to print the route correctly
ip_address_to_string returns a static buffer, need to make a copy
in this case.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-08 13:30:24 +01:00
Dan Williams
7206306456 core: fix hanlding of IPv6LL address if interface already has one
act_stage3_ip6_config_start() expects a non-NULL NMIP6Config if the
sub-method returns NM_ACT_STAGE_RETURN_SUCCESS.
2013-11-07 21:38:08 -06:00
Thomas Haller
c4a087c36d core: wait for IPv6 link local address with method 'auto' and 'link-local' (bgo#707155)
With the methods 'auto' and 'link-local' we check now, that the device
has a usable IPv6 LL address configured (after DAD, no longer tentative).

We wait for up to 5 seconds, for a suitable LL address to appear.
Currently, if the address does not get ready, we don't create one and
IPv6 configuration fails.

This is relevant for the methods 'link-local' and 'auto'. In the latter
case, because we cannot send router solitations without link local
address.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-08 00:46:33 +01:00
Thomas Haller
ac94d83f04 core: add ifa_flags to NMPlatformIP6Address structure
Add a field 'flags' to NMPlatformIP6Address that holds the
IFA_F_* flags as reported over netlink.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-08 00:46:33 +01:00
Thomas Haller
69d154012d core: omit "dev -" for *_to_string of NMPlatformIP* addresses and routes
The NMPlatformIP[46]Address and NMPlatformIP[46]Route structs have a
field 'dev'. Before this field was always printed in the *_to_string
functions and a missing device was signaled as ' dev -'.
This had the advantage, that the output contained the same fields
regardless whether there was a device set or not.

Change it, not to print the device if it is not set. This has the
advantage, that it looks better in the logfiles.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-08 00:45:44 +01:00
Dan Williams
6a3672ec9a docs: update for Team and Generic devices 2013-11-07 16:58:29 -06:00
Thomas Haller
f059298896 trivial: whitespace fix
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-07 21:32:08 +01:00
Thomas Haller
10bd060076 core: IPv6 mode link-local must not behave like auto (bgo#706618, bgo#707155)
In act_stage3_ip6_config_start, for IPv6 mode link-local, we check
if there is already an IPv6 address configured. If yes, we are
already done.

For now, as current workaround, if the LL does not exist, we
NM_ACT_STAGE_RETURN_STOP.

Later, we will POSTPONE and wait a timeout until we see a LL address
that is no longer TENTATIVE. The same should be done for method auto,
so that the device is usable to send router solitations (bgo#707155).

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-07 21:19:57 +01:00
Thomas Haller
03943e2854 trivial: make nm_connection_dump more forgiving when passing NULL
nm_connection_dump is mainly used for printf debugging, so
no need about being overly critical about not accepting NULL.
Just don't dump anything.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-07 19:30:38 +01:00
Dan Williams
a31dfea052 core: fix assumed active connection exporting after ff7e47a4 (core: kill PendingActivation and move authorization to NMActiveConnection)
Assumed active connections never got a D-Bus path and were never exported
to D-Bus.
2013-11-07 11:53:23 -06:00
Dan Williams
1bf16b6f06 core: fix bridge port sysfs directory determination after f5507633 (platform: bridging and bonding options)
The device is not a slave if it *doesn't* have a master.  Code
previously returned an error if the slave did have a master, which
is wrong.
2013-11-07 11:52:28 -06:00
Dan Williams
d22f279f53 core: fix 'hairpin_mode' after 9e19c3db (core: use nm_platform_*_*_option() for bridges) 2013-11-07 11:52:19 -06:00
Dan Williams
60cf32f271 trivial: quiet log message about failing to determine virtual interface name
In the case of autoconnect VLANs or IB partitions, if the parent interface
hasn't been detected yet at startup, then the get_virtual_interface_name()
won't be able to find the parent yet.  That's normal, and when the parent
is found, system_create_virtual_device() will be run again and the parent
will be found, and the autoconnect VLAN/IB partition will be created.

But we shouldn't warn that the parent can't be found when that might be
a normal occurance.
2013-11-07 11:33:16 -06:00
Thomas Haller
47a0cf2a6c core: add nm_ip6_config_dump function
Also improve nm_ip4_config_dump to print all properties and make
use of nm_platform_*_to_string.

Also, ensure that never_default is set to gboolean 1 or 0.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-07 18:22:34 +01:00
Jiří Klimeš
5a4e40bacf cli: fix 'nmcli con up bad_name' or 'nmcli con up'
** (process:25157): CRITICAL **: nmc_activate_connection: assertion `NM_IS_CONNECTION (connection) || ifname' failed
Error: unknown error.

Regression caused by 42c7ea85a1.
2013-11-07 18:01:16 +01:00
Dan Williams
6a60dc2fe9 settings: validate hostnames from D-Bus (bgo #711179)
Do some minimal verification of hostnames that come in via D-Bus, for
length and content.  Otherwise we'd get as far as asking glibc to set
the system hostname, which would reject us.
2013-11-07 09:56:14 -06:00
Dan Williams
0c3a2b1951 core: fix ignore-carrier behavior (bgo #710216)
Previously, ignore-carrier devices were always in the unavailable state
until they were activated.  This required some complicated code to keep
track of whether the device was available or not based on what connections
existed, whether those connections were static-IP, and whether the device
was ignore-carrier.

This had the side-effect of auto-activating DHCP connections on
ignore-carrier devices that didn't have a carrier, if that device had at
least one static IP connection available.  Not good.

Remove that complexity and confusion by making ignore-carrier devices
always move to DISCONNECTED state, and simply refuse to activate
connections that require connectivity, but allow connections that don't
require connectivity.  Also, when the device has no carrier, don't
add connections that require connectivity to the AvailableConnections
device property.

https://bugzilla.gnome.org/show_bug.cgi?id=710216
2013-11-06 18:37:32 -06:00
Dan Williams
779b699457 core: compatible connections are always available on master devices
Master devices depend on their slaves/ports for carrier status, so the
carrier can't factor into whether a connection is available on that
device or not.  If it did, then no connections could be activated
because the device doesn't have a carrier until slaves are attached.
2013-11-06 17:55:06 -06:00
Pavel Šimerda
2b2383e9c5 core: add device-generated connection to settings
Only NMSettingsConnections can be activated on device, and
get_connection() wasn't doing that.  So the generated connection
must be added to NMSettings.  That also triggers the
ConnectionProvider's 'connection-added' signal with the happy
result of adding the new connection to the device's
AvailableConnections list.

Acked-by: Dan Williams <dcbw@redhat.com>
2013-11-06 17:55:06 -06:00
Dan Williams
9d00229447 core: rework ignore-carrier device behavior
Previously, ignore-carrier devices were always in the unavailable state
until they were activated.  This required some complicated code to keep
track of whether the device was available or not based on what connections
existed, whether those connections were static-IP, and whether the device
was ignore-carrier.  Various bits of the code used nm_device_can_activate()
for two different purposes: (1) to determine if the device was available
on an L2 basis, which nm_device_can_activate() wasn't well-suited to, and
(2) whether a specific connection could be activated at a given time
based on ignore-carrier and whether the connection was static IP or not.

Remove that complexity and confusion by making ignore-carrier devices
always move to DISCONNECTED state, and simply refuse to activate
connections that require connectivity, but allow connections that don't
require connectivity.  Also, when the device has no carrier, don't
add connections that require connectivity to the AvailableConnections
device property.
2013-11-06 17:55:05 -06:00
Dan Williams
c4b121cb88 core: use carrier for determining when generic devices are available 2013-11-06 14:59:19 -06:00
Dan Winship
47cc8b25f2 libnm-glib: add NMDevice:physical-port-id property
Add the physical-port-id property to NMDevice so that clients can
recognize NPAR/SR-IOV devices.
2013-11-06 10:26:16 -05:00
Dan Winship
b7300bbe5a core: improve handling of NPAR/SR-IOV devices (rh #804527)
Use the new kernel physical_port_id interface property to recognize
when two devices are just virtual devices sharing the same physical
port, and refuse to bond/team multiple slaves on the same port.
2013-11-06 10:26:16 -05:00
Dan Winship
a4dcd66698 core: fix the reporting of failed slaves
If nm_device_enslave_slave() failed, the slave would log that it was
waiting for the master to activate (even if the master was already
active). Fix it to log an error and fail its activation instead.
2013-11-06 10:26:16 -05:00
Dan Winship
a1f16cd4d9 core: don't allow activating the same connection twice (rh #997998)
Change the rules for connection activation so that a given
NMConnection can only be used by a single NMActiveConnection at any
given time.
2013-11-06 10:21:27 -05:00
Dan Williams
154264d99c ifcfg-rh: clear DCB values when DCB is disabled 2013-11-05 14:11:04 -06:00
Enrico Nicoletto
beb56eab9a po: updated Brazilian Portuguese (pt_BR) translation (bgo #711439)
https://bugzilla.gnome.org/show_bug.cgi?id=711439

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-05 10:22:21 +01:00
Thomas Haller
2f900b9b8f gsystem: update libgsystem to current upstream master
This includes fixes for Coverity scans

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-05 10:10:22 +01:00