Commit graph

322 commits

Author SHA1 Message Date
Dan Winship
b860c7be4a infiniband: add transport-mode property
Add transport-mode property to NMSettingInfiniband (and parse it
correctly in ifcfg-rh), and set it up properly on the device in
NMDeviceInfiniband.
2012-01-26 09:58:48 -06:00
Thomas Graf
1ba50e2f1b bonding: export path of master device property over DBUS
Adds a new "master" property to NMActiveConnection containing the path
of the master NMDevice if the connection has a master.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-01-25 11:12:43 -06:00
Dan Williams
a868fd5a98 core: don't flush routes/addresses on invalid interface indexes
The NM 'iface' isn't always the IP iface (like for modems) so
to avoid a warning, only flush routes and addresses on deactivate
when the iface can actually handle it.
2011-12-12 14:01:21 -06:00
Dan Williams
fcc441622a core: add generic queued state transitions
There are now three places we need delayed state transitions:

1) unavailable to disconnected
2) failed to disconnected
3) bond unavailable to disconnected

(3) wasn't doing a delayed transition, but we can't change
state from inside a state-change handler otherwise we may not
end up fully processing the current state chagne.  So it needs a
delayed transition too; add some generic code to make that
easier to do.
2011-12-08 11:46:58 -06:00
Thomas Graf
916631f15a bonding: abort activation of unknown slave types
Abort activation of slaves which are unknown and log successful
enslave/release.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-08 10:34:35 -06:00
Dan Williams
dff0d2a189 core: ensure correct IP family completion is scheduled
The callers of fw_add_to_zone() were passing an 'int' (AF_INET or
AF_INET6) while that function was expecting a boolean.  Thus when
IPv6 functions passed AF_INET6 that would be interpreted as TRUE
and IPv4 operations would be scheduled.
2011-12-06 17:31:46 -06:00
Dan Williams
768d54bcc6 core: use right IP family when commiting IP configuration
IPv6 needs to clear it's own activation chain, not IPv4's.
2011-12-06 17:17:34 -06:00
Dan Williams
469b263043 core: better failure handling when starting IP configuration
First, log when there's an unhandled IP config method, and
second, assume failure in IPv4 configs.  IPv6 already did.
2011-12-06 17:00:40 -06:00
Dan Williams
4fd510cbcd trivial: move some log messages earlier
Would have been helpful to more easily catch a bug cyphermox and
I were discussion on IRC.
2011-12-06 16:36:37 -06:00
Thomas Graf
18088e0d07 trivial: add nm_device_get_connection()
Shortcut to access the connection linked to the activation
request of a device.

The patch only replaces usage with nm_device_get_connection()
if the existing code assumes that an activation request must
be available.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-06 16:10:23 -06:00
Thomas Graf
5b7503e95e core: use nm_connection_get_setting_<type>() whenever possible
Leads to shorter, easier to read code and improves type casting safety.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-06 16:06:43 -06:00
Dan Williams
8e53a44cdd core: clean up per-device rfkill handling
Add an accessor for device rfkill type and use that instead of
GObject properties, and also use that accessor when claiming a
new device instead of checking NM_IS_DEVICE_xxxx().  Allows us
to move one step closer to making WiMAX a plugin.
2011-12-02 13:30:08 -06:00
Dan Williams
da8e21a7d7 core: kill NMDeviceInterface 2011-12-02 13:30:07 -06:00
Dan Williams
6d567e71e6 core: move NMDeviceInterface properties and methods to nm-device.c 2011-12-02 13:30:07 -06:00
Dan Williams
296b488ad4 core: move state-changed signal to nm-device.c 2011-12-02 13:30:07 -06:00
Dan Williams
905f2cdf9a core: move NMDeviceInterfaceError to nm-device.c 2011-12-02 13:30:07 -06:00
Dan Williams
2b1708865f core: move nm_device_interface_deactivate() to nm-device.c 2011-12-02 13:30:07 -06:00
Dan Williams
3caf0c80e4 core: move nm_device_interface_activate() to nm-device.c 2011-12-02 13:30:07 -06:00
Dan Williams
dcce47bea6 core: move nm_device_interface_disconnect() to nm-device.c 2011-12-02 13:30:07 -06:00
Dan Williams
827d9defb9 core: move nm_device_interface_set_enabled() to nm-device.c 2011-12-02 13:30:07 -06:00
Dan Williams
51c25508c2 core: move nm_device_interface_get_enabled() to nm-device.c 2011-12-02 13:30:07 -06:00
Dan Williams
c71656ff07 core: move nm_device_interface_spec_match_list() to nm-device.c 2011-12-02 13:30:07 -06:00
Dan Williams
2db920659f core: move nm_device_interface_connection_match_config() to nm-device.c 2011-12-02 13:30:07 -06:00
Dan Williams
1287c8e18d core: move nm_device_interface_can_assume_connections() to nm-device.c 2011-12-02 13:30:07 -06:00
Dan Williams
4f330838bd core: move nm_device_interface_check_connection_compatible() to nm-device.c 2011-12-02 13:30:06 -06:00
Dan Williams
e5c1a0ed13 core: move NMDevice private functions to nm-device-private.h
Move stuff that's not "public" API of NMDevice to the private
header that's only used by subclasses.
2011-12-02 13:30:06 -06:00
Dan Winship
5366c3d6d4 wired: split NMDeviceWired out of NMDeviceEthernet and add NMDeviceInfiniband 2011-12-02 13:09:16 -06:00
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
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
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
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
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
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
04ecdb8187 zones: fix up formatting and simplify some functions 2011-11-09 22:06:36 -06:00
Jiri Popelka
1c0aeb4575 firewall: add firewall manager
src/firewall-manager tracks whether firewall is on the bus or not.
In nm-device.c at stage5 (ip-config-commit) before we actually
apply the IP configuration to the interface, we send the
IP interface name and zone to firewall and asynchronously wait
for a D-Bus reply.  Then after we get the reply
(or if the firewall isn't running) we proceed with
applying the IP configuration to the interface.
2011-11-09 22:02:02 -06:00
Dan Williams
56513f5289 ip6: save autoconf config when starting DHCP
Otherwise it just gets lost, and we want it later to combine with
the DHCP config to get the final config that's applied to the interface.
2011-11-09 21:36:52 -06:00
Dan Williams
8434f3b3e0 core: combine DHCP and RA IPv6 configs when either changes
Since both RA and DHCP may be run at the same time, we want to
make sure to merge both configs into a final config when either
RA or DHCP changes.  Previously this only happened when RA changed,
but not when DHCP changed or completed.  This caused the config
applied when DHCP completed to not contain the RA-derived address,
which was then removed from the device, which then regressed the
IPv6 RA state, causing a device failure.

Found by Tore Anderson

Oct 18 18:35:00 wrath dhclient[13782]: RCV: Reply message on eth0 from fe80::ca6c:87ff:feab:da5f.
Oct 18 18:35:00 wrath NetworkManager[12390]: <info> (eth0): DHCPv6 state changed nbi -> renew6
Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642273] [nm-device.c:1582] dhcp6_state_changed(): (eth0): new DHCPv6 client state 7
Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642282] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'interface'=>'eth0'
Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642288] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'new_dhcp6_client_id'=>'0:3:0:1:0:30:1b:bc:7f:23'
Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642294] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'reason'=>'RENEW6'
Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642300] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'new_dhcp6_name_servers'=>'2001:840:100:: 2001:840:200::'
Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642305] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'new_dhcp6_server_id'=>'0:3:0:1:c8:6c:87🆎da:5f'
Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642311] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'pid'=>'13782'
Oct 18 18:35:00 wrath NetworkManager[12390]: <info> Activation (eth0) Stage 5 of 5 (IPv6 Commit) scheduled...
Oct 18 18:35:00 wrath NetworkManager[12390]: <info> Activation (eth0) Stage 5 of 5 (IPv6 Commit) started...
Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.643641] [nm-system.c:182] sync_addresses(): (eth0): syncing addresses (family 10)
Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.643655] [nm-system.c:235] sync_addresses(): (eth0): removing address '2001:840:3033:20:230:1bff:febc:7f23/64'
Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.643702] [nm-system.c:218] sync_addresses(): (eth0): ignoring IPv6 link-local address
Oct 18 18:35:01 wrath NetworkManager[12390]: <info> Policy set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS.
Oct 18 18:35:01 wrath NetworkManager[12390]: <info> Activation (eth0) Stage 5 of 5 (IPv6 Commit) complete.
Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656335] [nm-ip6-manager.c:1041] netlink_notification(): netlink notificate type 21
Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656345] [nm-ip6-manager.c:542] process_addr(): processing netlink new/del address message
Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656359] [nm-ip6-manager.c:1069] netlink_notification(): (eth0): syncing device with netlink changes
Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656367] [nm-ip6-manager.c:419] nm_ip6_device_sync_from_netlink(): (eth0): syncing with netlink (ra_flags 0x800000B0) (state/target 'got-address'/'got-address')
Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656376] [nm-ip6-manager.c:438] nm_ip6_device_sync_from_netlink(): (eth0): netlink address: fe80::230:1bff:febc:7f23
Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656382] [nm-ip6-manager.c:460] nm_ip6_device_sync_from_netlink(): (eth0): addresses synced (state got-address)
Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656388] [nm-ip6-manager.c:474] nm_ip6_device_sync_from_netlink(): router advertisement requests parallel DHCPv6
Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656393] [nm-ip6-manager.c:512] nm_ip6_device_sync_from_netlink(): (eth0): RA-provided address no longer valid
Oct 18 18:35:01 wrath NetworkManager[12390]: <info> (eth0): DHCPv6 client pid 13782 exited with status 0
Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656448] [nm-device.c:1582] dhcp6_state_changed(): (eth0): new DHCPv6 client state 23
Oct 18 18:35:01 wrath NetworkManager[12390]: <info> (eth0): device state change: activated -> failed (reason 'ip-config-unavailable') [100 120 5]
2011-11-09 21:36:52 -06:00
Dan Williams
3927ccd1c0 core: decouple initial IP configuration states from device state
Initial IP configuration can happen during ACTIVATED state if both
v4 and v6 are enabled, but one takes longer than the other.  Thus
various checks throughout the code for IP_CONFIG were incorrect
since they depended on IP configuration only happening during the
IP_CONFIG state.  Fix that by using a separate state for IP config
and using that state for various checks instead of the overall
device state.
2011-11-09 21:36:52 -06:00
Dan Williams
bdd556fe4d core: kill stage4 (IP Config Get)
It was somewhat pointless since the IP config is always known when
stage4 gets scheduled, so why not just pass the config to stage5
immediately?  Also helps consolidate the v4/v6 failure handling
logic and makes the operational flow clearer where both v4 and
v6 are active and proceeding in parallel.
2011-11-09 21:36:52 -06:00
Dan Williams
22d72483f6 core: remove unused 'config' parameter from IP timeout methods
Long ago used to create an IPv4 LL config when DHCP failed, but
we don't do that anymore, and it should be done differently anyway.
2011-11-09 21:36:52 -06:00
Dan Williams
31c09eeab2 core: remove unused prototype 2011-11-09 21:36:52 -06:00
Dan Williams
d90f0e186a core: consolidate DHCP failure handling code 2011-11-09 21:36:51 -06:00
Dan Williams
7050e6909c core: more DHCPv6 code shuffle
No functional changes.
2011-11-09 21:36:51 -06:00
Dan Williams
7e1b58234a core: split DHCPv4 and DHCPv6 state and lease handling code 2011-11-09 21:36:51 -06:00
Dan Williams
c821702276 core: move some more code around
No functional changes.
2011-11-09 21:36:51 -06:00
Dan Williams
e8bbcca3b5 core: move some code around
No functional changes, but prepare for splitting DHCPv4 and DHCPv6
code apart.
2011-11-09 21:36:51 -06:00
Mathieu Trudel-Lapierre
d5eee91134 device: allow for applying IPv4 and IPv6 settings in parallel
We don't really need to wait before both IPv4 and IPv6 are established before
applying all the settings to the device. Instead, we can apply each separately
when they are ready, which will bring up the interface sooner.
2011-11-09 21:34:01 -06:00
Jiří Klimeš
077afa02f5 core: correct shared IP range to be 10.42.x.1 as is documented (bgo #657127)
This fixes possible "overflow" of range from 10.42.x.1 to the fourth (on LSB)
or the second (on MSB) octet.
2011-11-03 09:20:03 +01:00