Commit graph

280 commits

Author SHA1 Message Date
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
Mathieu Trudel-Lapierre
b687872f68 ip6: make sure static routes are flushed for manual configs too
Manual configs don't require an IP6Manager object and thus static
routes wouldn't get flushed on device deactivation.
2011-10-10 16:36:36 -05:00
Thomas Graf
00f2b0a9bb core: Include <linux/if.h> instead of <net/if.h>
NM already includes <linux/if.h> in some places, f.e. nm-netlink-monitor and
we can't mix usage of the two. Stick to using <linux/if.h> as it provides
additional flag definitions such as operational link state and link mode.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-09-30 00:18:24 -05:00
Dan Williams
e63dc96a8f core: release DHCP lease when requested instead of always 2011-09-21 00:30:38 -05:00
Jiří Klimeš
60ed3839fb core: print textual description for reason codes on device deactivation too 2011-09-19 14:22:00 +02:00
Thomas Graf
d6864d7cf5 core: Fix check for failure in translating link name to ifindex
rtnl_link_name2i() returns 0 (unspecified ifindex) if translation
did not succeed.
2011-09-14 12:25:35 -05:00
Dan Williams
420fbb599f sharing: fix handling of rule negation (debian #638995)
! after the option is deprecated at least as far back as iptables
1.4.12 on 2.6.32.  ! should be before the option instead.

Reported-by: Ralf Jung <ralfjung-e@gmx.de>
2011-09-06 18:31:40 -05:00
Alfredo Matos
a6c6556831 core: add libnl-2 support with libnl-1 compatibility 2011-07-30 15:47:26 -05:00
Dan Williams
2fabdbff15 core: finish conversion of nm-system functions to ifindex not iface name 2011-07-22 14:24:18 -05:00
Dan Williams
efb5735ad1 core: more conversion to ifindex instead of iface 2011-07-22 14:09:16 -05:00
Dan Williams
c742cc83fd core: convert up/down check to netlink and use interface index not iface 2011-07-22 13:49:49 -05:00
Dan Williams
d2d1f2e9e0 core: use interface indexes more 2011-07-22 13:37:29 -05:00
Dan Williams
a2acfdd46b core: simplify device activation precheck
The FIXME is correct; comparing the whole connection is just dumb now
since all connections are owned by NM, so we can simply compare pointers
to figure out of the incoming activation request is using the same
connection as the current activation request.  Plus, this comparison
would fail entirely if the connection has transient/always-ask secrets.
2011-06-07 14:22:55 -05:00
Dan Williams
459e7b9518 api/core: add ActiveConnection property to device objects
Enables easier traversal of the object hierarchy; if a client is
watching signals on a device they can easily get back to the
parent NMActiveConnection object to grab connection details or
status.
2011-05-26 19:19:32 -05:00
Dan Williams
5e2cda5c20 core: fix typo 2011-05-09 13:55:19 -05:00
Dan Williams
c4b922ed21 core: emit textual descriptions of device state changes
Throw users a bone about what's happening.
2011-05-03 11:57:26 -05:00
Dan Williams
f898dbf1a9 dispatcher: enhance dispatcher script environment (bgo #648382)
For VPN connections, the interface name would be that of the VPN's
IP interface, but the script environment would be the that of the
VPN's parent device.  Enhance the environment by adding any VPN
specific details as additional environment variables prefixed by
"VPN_".  Leave the existing environment setup intact for backwards
compatiblity.

Additionally, the dispatcher never got updated for IPv6 support,
so push IPv6 configuration and DHCPv6 configuration into the
environment too.

Even better, push everything the dispatcher needs to it instead
of making the dispatcher make D-Bus requests back to NM, which
sometimes fails if NM has already torn down the device or the
connection which the device was using.

And add some testcases to ensure that we don't break backwards compat,
the testcases here were grabbed from a 0.8.4 machine with a hacked up
dispatcher to dump everything it was given from NM.
2011-05-02 22:54:28 -05:00
Dan Williams
5e21728e59 core: suppress error messages if addresses/routes already exist 2011-04-05 10:19:08 -05:00
Dan Williams
23943e7ce2 core: handle new device states
The device states aren't used yet, but handle them anyway.
2011-03-17 13:42:22 -05:00
Dan Williams
fcbaa00ed0 core: remove some debug logging 2011-03-15 12:22:54 -05:00
Kjartan Maraas
c2b4b9c1d7 build: fix return types (bgo #644665)
Some functions were returning FALSE or 0 instead of NULL.
2011-03-14 01:05:51 -05:00
Jiří Klimeš
c207d020f7 core: use nm_connection_get_id() and nm_connection_get_uuid() to simplify code 2011-03-08 13:41:28 +01:00
Dan Williams
bf854ebaca ip6: fail activation if addrconf fails to start
Like if the IP interface doesn't have an ifindex yet.  Previously
the connection would just go merrily along and wait for IPv6 to
complete even though it had already failed.  Happens if you try
to do IPv6 on mobile broadband connections, which we'll add support
for later.
2011-02-25 11:28:08 -06:00
Dan Williams
125540471b core: don't require serial and PPP settings for mobile broadband
If they are there, use them.  If not, make them up on the fly.
2011-02-25 11:24:20 -06:00
Dan Williams
3b61adec74 core: consolidate deactivation methods
deactivate_quickly is misnamed these days; it was originally used
for quickly tearing down a device for sleep and such.  But these
days it's used for the bulk of device deactivation.  Only the wifi
class used the actual deactivate method.  So combine the two and
make device implementations less complicated.
2011-02-24 11:27:42 -06:00
Dan Williams
e050f44ab6 core: flush IPv6 routes even if configuration failed (bgo #641333)
If configuration fails, there won't be an IPv6 config for the device,
thus the route flush when deactivating the device if it fails would
only flush IPv4 routes.  We don't know how far through IPv6 setup
we got, so we do want to flush IPv6 routes on deactivate if we
started IPv6 config at any point.
2011-02-23 17:20:19 -06:00
Dan Williams
b7259fd2a8 Merge remote branch 'origin/master' into rm-userset 2011-01-25 15:41:03 -06:00
Dan Williams
1187922adf core: lack of an IPv4 setting indicates DHCP (novell #664640)
It shouldn't assert.
2011-01-14 14:02:02 -06:00
Dan Williams
53766ae291 core: move generic connection complete function to a generic location
Out of NMDevice specific places to the utils code, so it can be used
more easily from everywhere.  There's nothing device-specific about
it anyway.
2011-01-13 13:28:52 -06:00
Dan Williams
f9ceafd4a1 Merge remote branch 'origin/master' into rm-userset 2011-01-12 15:46:37 -06:00
Dan Williams
215306f5a1 core: add AddAndActivate D-Bus method
Given connection details, complete the connection as well as possible
using the given specific object and device, add it to system
settings, and activate it all in one method.
2011-01-10 23:39:12 -06:00
Dan Williams
9917da2c71 dhcp: add DHCP lease release capability 2011-01-05 16:23:00 -06:00
Dan Williams
71adbcbb20 Revert "wimax: if the device is connected at startup, force it to disconnect"
This reverts commit 9c99066d6c.

Yay for finger-memory of git commit -a...
2011-01-05 15:38:03 -06:00
Dan Williams
9c99066d6c wimax: if the device is connected at startup, force it to disconnect
Otherwise it doesn't auto-scan and we get no network list.  As a later
optimization, we could detect this, call iwmx_sdk_get_connected_network()
to get the current NSP, match that up with a connection, and "assume"
the connection like we do for Ethernet devices.
2011-01-05 15:30:59 -06:00
Dan Williams
1ec327130a core: factor out DHCPv4 setup 2011-01-05 14:07:32 -06:00
Dan Williams
62a2c34e27 core: simplify secrets handling during activation
Instead of a bizare mechanism of signals back to the manager
object that used to be required because of the user/system settings
split, let each place that needs secrets request those secrets
itself.  This flattens the secrets request process a ton and
the code flow significantly.

Previously the get secrets flow was something like this:

nm_act_request_get_secrets ()
    nm_secrets_provider_interface_get_secrets ()
        emits manager-get-secrets signal
            provider_get_secerts ()
                system_get_secrets ()
                    system_get_secrets_idle_cb ()
                        nm_sysconfig_connection_get_secrets ()
                            system_get_secrets_reply_cb ()
                                nm_secrets_provider_interface_get_secrets_result ()
                                    signal failure or success

now instead we do something like this:

nm_agent_manager_get_secrets ()
    nm_agent_manager_get_secrets ()
        request_start_secrets ()
            nm_sysconfig_connection_get_secrets ()
                return failure or success to callback
2010-12-13 21:14:23 -06:00
Dan Williams
8f7aedc7e0 Merge remote branch 'origin/master' into rm-userset 2010-10-18 19:02:27 -05:00
Dan Williams
be97e7f104 build: include <config.h> for kill(2), isblank(3), and isascii(3)
config.h defines _GNU_SOURCE, which in turn defines the bits necessary
for kill, isblank, and isascii.  So wherever we use those, we need
to make sure config.h is included.
2010-10-08 22:46:55 -05:00
Dan Williams
8b41f70dd5 Merge remote branch 'origin/master' into rm-userset 2010-09-27 10:30:46 -05:00
Jiří Klimeš
358261ccd9 core: read initial MAC address on startup; reset to this MAC when disconnecting
Previously, NM reset permanent MAC to an interface while disconnecting. That
basically ignored MAC addresses set before NM started managing the interface.
Now, the initial MAC address is remembered and set back to the interface when
disconnecting.
2010-09-27 09:53:51 +02:00
Dan Williams
b80f31e191 trivial: typo fixes
Sent by a Debian user to Michael Biebl.  No other attribution
information available.  Thanks Debian user!
2010-09-25 00:34:10 -05:00
Dan Williams
6e287e4179 Merge remote branch 'origin/master' into rm-userset 2010-09-16 17:10:49 -05:00
Dan Williams
64b6cd1ebc core: add DNS plugin config options 2010-09-09 17:14:20 -05:00