Commit Graph

7207 Commits

Author SHA1 Message Date
Dan Williams
8a59706712 ip6: ensure manager singleton is cleared when disposed 2010-04-30 17:30:11 -07:00
Dan Williams
7b3103b5eb ip6: initialize IPv6 address config a bit later
Stage 1 gets overridded by most device subclasses and it turns out
they don't every chain back up to NMDevice's stage1 implementation.
It's a bit complicated to make them all do that, so for now just
move the IPv6 address config a bit later.
2010-04-30 16:10:29 -07:00
Dan Williams
a64600d796 ip6: bump the autoconf RA timeout a bit
The RA interval is configurable on the router and we don't want
to miss one.  20s is still a lot less than we allow for DHCP so
the latency isn't that big of an issue.
2010-04-30 16:09:36 -07:00
Dan Williams
b24f5c8da9 ip6: 'manual' method doesn't use the IP6 manager 2010-04-30 16:09:02 -07:00
Dan Williams
7e980d8be3 ip6: fix manual IP config application 2010-04-30 15:49:41 -07:00
Dan Williams
93d1d81938 Revert "dbus: add Debian D-Bus permission config"
This reverts commit 3d69429a1e.

Apparently the 'netdev' group rules aren't as widespread anymore
and Debian ships with ConsoleKit by default, and thus can
use at_console.
2010-04-30 11:44:56 -07:00
Dan Williams
3d69429a1e dbus: add Debian D-Bus permission config
From Michael Biebl and the debian packages.
2010-04-30 11:18:12 -07:00
Dan Williams
9830c60d11 dhcp: fix superclass type of dhcpcd plugin
From Mikhail Efremov <sem@altlinux.org>
2010-04-29 11:31:43 -07:00
Dan Williams
17e0749c76 ip6: disconnect netlink signal handler on dispose 2010-04-27 17:16:02 -07:00
Jiří Klimeš
ea1e6f2f7b ip6: fix a crash when /proc/sys/net/ipv6/conf/<iface>/* files are not present 2010-04-27 15:59:46 +02:00
Dan Williams
c3ebe98ae3 Merge remote branch 'origin/ip6only' 2010-04-26 17:33:45 -07:00
Dan Williams
5331c22adf dns: filter duplicates while constructing resolv.conf 2010-04-26 16:09:25 -07:00
Dan Williams
b127f4aa98 ip6: move class boilerplate/setup to the bottom 2010-04-26 15:04:01 -07:00
Dan Williams
de1a4dcc4b ip6: fix autoconf address and route scraping
Two things:

1) we need to bounce IPv6 on the interface because otherwise the
kernel won't start listening for new RAs.  So code gets added
to handle the 'disable_ipv6' /proc/sys/net/ipv6 parameter for
each interface.

2) Second, we need to grab a default route (if we find one) before
reading addresses, so that we can add it to each address that we
get out of the kernel.  Most of the time we'll get an -EEXIST error
when adding address, but that's OK since we're just trying to add
the same route back that the kernel already added from the RA.  We
also need to make sure the route and address caches are up-to-date
otherwise we won't get a complete picture of the routing table.
2010-04-26 14:08:10 -07:00
Dan Williams
11a6225aac ip6: correctly handle routes with no gateways
For these we don't need to set any gateway at all, and the kernel
assumes that it's a default route without a next hop.
2010-04-26 14:06:58 -07:00
Dan Williams
08c33651c7 test: needs -ldl too for logger code 2010-04-26 13:51:19 -07:00
Dan Williams
9b944dec96 core: ignore mobile broadband ethernet devices that aren't usable (rh #585214)
Not all ethernet devices are immediately usable; newer mobile broadband
devices (Ericsson, Option, Sierra) require setup on the tty before the
ethernet device is usable.  2.6.33 and later kernels set the 'DEVTYPE'
uevent variable which we can use to ignore the interface as a NMDevice
subclass.  ModemManager will pick it up though and so we'll handle it
through the mobile broadband stuff.
2010-04-25 09:52:01 -07:00
Dan Williams
e218092d62 core: first pass of IPv6 routing and DNS update on IP config change
Mostly the same as the IPv4 bits; dupe them for IPv6.  A lot of
duplicated code, but it's hard to consolidate.
2010-04-23 22:11:22 -07:00
Dan Williams
837364726b dns: handle IPv6 nameservers more like IPv4 ones 2010-04-23 22:08:56 -07:00
Dan Williams
bb936cd46c core: ensure IP stage failure when stuff actually fails 2010-04-23 21:52:10 -07:00
Dan Williams
8d0d80d8df core: assure a valid IPv6 config on timeout success 2010-04-23 21:51:09 -07:00
Dan Williams
aaf10a8edb core: don't pointlessly clear IP6 config on success 2010-04-23 21:48:16 -07:00
Dan Williams
6b63481d4d core: prepare for IPv6 routing and DNS stuff 2010-04-23 16:37:45 -07:00
Dan Williams
b172519045 core: fail connections if IP configuration expires
Need to mark these connections invalid too, otherwise they'll just be
retried over and over and over.  Ran into a problem with DHCPv6 where
lease expiration (cached lease really) was *negative*, which caused
the lease to expire immediately after being bound.  Previously the
policy wouldn't mark connections like this as invalid because they
hadn't failed during activation.

NetworkManager: <info> (eth0): carrier now ON (device state 2)
NetworkManager: <info> (eth0): device state change: 2 -> 3 (reason 40)
NetworkManager: <info> Activation (eth0) starting connection 'dhcp6 test'
NetworkManager: <info> (eth0): device state change: 3 -> 4 (reason 0)
NetworkManager: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled...
NetworkManager: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) started...
NetworkManager: <info> Activation (eth0) Stage 2 of 5 (Device Configure) scheduled...
NetworkManager: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) complete.
NetworkManager: <info> Activation (eth0) Stage 2 of 5 (Device Configure) starting...
NetworkManager: <info> (eth0): device state change: 4 -> 5 (reason 0)
NetworkManager: <info> Activation (eth0) Stage 2 of 5 (Device Configure) successful.
NetworkManager: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled.
NetworkManager: <info> Activation (eth0) Stage 2 of 5 (Device Configure) complete.
NetworkManager: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) started...
NetworkManager: <info> (eth0): device state change: 5 -> 7 (reason 0)
NetworkManager: <info> Activation (eth0) Beginning DHCPv6 transaction (timeout in 45 seconds)
NetworkManager: <info> dhclient started with pid 6639
NetworkManager: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.
Internet Systems Consortium DHCP Client 4.1.1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

NetworkManager: <info> (eth0): DHCPv6 state changed nbi -> preinit6
Bound to *:546
Listening on Socket/eth0
Sending on   Socket/eth0
PRC: Confirming active lease (INIT-REBOOT).
XMT: Forming Confirm, 0 ms elapsed.
XMT:  X-- IA_NA 5a:47:1f:71
XMT:  | X-- Confirm Address 3ffe:501:ffff::4
XMT:  V IA_NA appended.
XMT: Confirm on eth0, interval 1090ms.
send_packet6: Cannot assign requested address
dhc6: sendpacket6() sent -1 of 80 bytes
XMT: Forming Confirm, 1090 ms elapsed.
XMT:  X-- IA_NA 5a:47:1f:71
XMT:  | X-- Confirm Address 3ffe:501:ffff::4
XMT:  V IA_NA appended.
XMT: Confirm on eth0, interval 2120ms.
send_packet6: Cannot assign requested address
dhc6: sendpacket6() sent -1 of 80 bytes
XMT: Forming Confirm, 3210 ms elapsed.
XMT:  X-- IA_NA 5a:47:1f:71
XMT:  | X-- Confirm Address 3ffe:501:ffff::4
XMT:  V IA_NA appended.
XMT: Confirm on eth0, interval 4320ms.
XMT: Forming Confirm, 7530 ms elapsed.
XMT:  X-- IA_NA 5a:47:1f:71
XMT:  | X-- Confirm Address 3ffe:501:ffff::4
XMT:  V IA_NA appended.
XMT: Confirm on eth0, interval 2470ms.
Max retransmission duration exceeded.
PRC: Bound to lease 00:01:00:01:12:e1:92:d9:00:14:22:fd:06:e7.
PRC: Rebind event scheduled in -8604281 seconds, to run for 110 seconds.
PRC: Depreference scheduled in -8604241 seconds.
PRC: Expiration scheduled in -8604171 seconds.
PRC: Rebinding lease on eth0.
PRC: Depreference scheduled in -8604241 seconds.
PRC: Expiration scheduled in -8604171 seconds.
NetworkManager: <info> (eth0): DHCPv6 state changed preinit6 -> bound6
NetworkManager: <info> Activation (eth0) Stage 4 of 5 (IP6 Configure Get) scheduled...
NetworkManager: <info> Activation (eth0) Stage 4 of 5 (IP6 Configure Get) started...
NetworkManager: <info>   address 3ffe:501:ffff::4
NetworkManager: <info>   prefix 64
NetworkManager: <info>   nameserver '2000::2'
NetworkManager: <info>   domain search 'ibm.com.'
NetworkManager: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled...
NetworkManager: <info> Activation (eth0) Stage 4 of 5 (IP6 Configure Get) complete.
NetworkManager: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) started...
PRC: Address 3ffe:501:ffff::4 depreferred.
PRC: Expiration scheduled in -8604171 seconds.
PRC: Address 3ffe:501:ffff::4 expired.
PRC: Bound lease is devoid of active addresses.  Re-initializing.
PRC: Soliciting for leases (INIT).
XMT: Forming Solicit, 0 ms elapsed.
XMT:  X-- IA_NA 5a:47:1f:71
XMT:  | X-- Request renew in  +3600
XMT:  | X-- Request rebind in +5400
XMT: Solicit on eth0, interval 1040ms.
Stopping nscd: [  OK  ]
Starting nscd: [  OK  ]
NetworkManager: <info> (eth0): device state change: 7 -> 8 (reason 0)
NetworkManager: <info> Activation (eth0) successful, device activated.
NetworkManager: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete.
NetworkManager: <info> (eth0): DHCPv6 state changed bound6 -> depref6
NetworkManager: <info> (eth0): DHCPv6 state changed depref6 -> expire6
2010-04-23 15:52:09 -07:00
Dan Williams
eaa750dda9 dhcp: add missing DHCPv6 client states 2010-04-23 15:30:46 -07:00
Dan Williams
4a2bb8b647 core: don't even bother running IPv4 or IPv6 when they are disabled 2010-04-23 12:56:33 -07:00
Dan Williams
1d882c8ade Merge remote branch 'origin/master' into ip6only 2010-04-23 12:13:24 -07:00
Dan Williams
e46577ffe5 core: rearrange version macros a bit 2010-04-23 12:12:47 -07:00
Jiří Klimeš
b0548425d7 logging: log NetworkManager version; use distribution version when configured 2010-04-23 15:25:32 +02:00
Jiří Klimeš
8315a03632 core: return valid error to dbus-glib (rh #581794) 2010-04-23 13:12:41 +02:00
Jiří Klimeš
a4cc8873c9 system-settings: fix loading connection by plugins
The error case was as follows. When using 'ifupdown,keyfile' plugins
and 'eth0' present in /etc/network/interfaces on a Debian-based system,
'ifupdown' plugin, in unmanaged mode, load_connections() prematurely
and thus effectively blocked reading connections from 'keyfile' plugin.
Patch by Dan and tested by me.
2010-04-23 12:13:04 +02:00
Simon Schampijer
c309a2bc8a wifi: fix B/G band adhoc wifi auto channel selection 2010-04-22 17:14:33 -07:00
Dan Williams
eafb1a6725 Merge remote branch 'origin/master' into ip6only 2010-04-22 14:20:24 -07:00
Dan Williams
6d6f7d3d90 core: ensure errors are dbus-glib accessible (rh #581794)
Errors that can possibly be returned from D-Bus method calls
need to be registered with dbus-glib.
2010-04-22 12:27:31 -07:00
Dan Williams
2ce8028e10 ip6: fix IPv6 addrconf detection and completion
Poll the device's IPv6 flags so we're notified when the RA has
been parsed and what the flags are.  Only when that's complete
and the device's target state has been reached (or Managed mode
was indicated by the RA) should we continue with IP configuration.
2010-04-21 15:43:34 -07:00
Dan Williams
5750529ff5 ip6: make sure IPv6 addrconf is cleaned up correctly 2010-04-21 15:20:16 -07:00
Dan Williams
34793c1fb1 core: use ifindex instead of interface name in a lot of places
Where we can do so, let's use ifindex since that's actually unique
and doesn't change when the interface name changes.  We already use
ifindex in a bunch of places, and netlink *only* uses ifindex, so
this will make it easier later when we move over to ifindexes fully.
2010-04-21 14:58:25 -07:00
Dan Williams
9fee99e123 netlink: provide both blocking and nonblocking netlink connections
The non-blocking connection is really only good for listening for
events.  It doesn't work for request/response operations (like
refilling link and address caches) because the message receive loop
in libnl will break out from the EAGAIN before it gets the response
it needs to update the cache with.

This is most evident with link cache refills when requesting the
interface index from the name, or vice-versa; the refill request
exits early with EAGAIN (due to the non-blocking nature of the
connection's socket) and the cache isn't refilled, and the index
lookup fails.  We need to use blocking netlink operations in quite
a few places besides index lookups, from address/route operations
to getting the initial device carrier state.

So, split the montior's netlink connection into a non-blocking
event listener connection, and a synchronous connection which gets
used for immediate operations.  This also has the effect of
validation the synchronous operations for security, which wasn't
done before in nm-netlink.c (though it wasn't really a problem).
2010-04-21 14:16:07 -07:00
Dan Williams
7cec17fcce netlink: fix checking multicast groups
Got the flags wrong in the previous commit; MULTI isn't about
multicast/unicast, but about multi-part packets.  Instead we need
to check the netlink sockaddr structure for the group mask.
2010-04-21 01:05:08 -07:00
Dan Williams
df3f09b633 netlink: fix group subscription 2010-04-20 17:24:49 -07:00
Dan Williams
87c6e5db76 netlink: merge nm-netlink.c into nm-netlink-monitor.c 2010-04-20 17:22:58 -07:00
Dan Williams
f722b180e2 trivial: netlink header cleanup 2010-04-20 16:55:13 -07:00
Dan Williams
5b8b9fc608 netlink: fix IPv6 RA flag retrieval
The RA flags aren't in the link flags, they are in the special
PROTINFO flags that the IPv6 stack sends.  To get these, because
libnl doesn't have native support for them, we get to parse the
netlink messages directly.  Furthermore, the PROTINFO message
isn't sent unless it's explicitly requested with a
RTM_GETLINK/AF_INET6 message, meaning we get to poll for it
periodically.

So switch over to the netlink monitor object (killing a lot of
duplicate code) and start requesting the PROTINFO bits from
netlink.
2010-04-20 16:46:08 -07:00
Dan Williams
9476355be2 trivial: remove dead CFLAGS 2010-04-20 16:33:55 -07:00
Dan Williams
d1c7c37863 netlink: implement generic group subscription
Needed by the IPv6 manager.
2010-04-20 16:32:03 -07:00
Dan Williams
b3d8337465 netlink: s/monitor/self 2010-04-20 15:59:50 -07:00
Dan Williams
952745d4d3 netlink: add header part of 6695eb7423 2010-04-20 15:59:18 -07:00
Dan Williams
6695eb7423 netlink: let clients get netlink message for generic parsing
First step on the way to killing the IPv6-specific netlink listener.
2010-04-20 15:54:55 -07:00
Dan Williams
dd3848ea45 netlink: move generic GObject stuff to the bottom 2010-04-20 15:31:54 -07:00
Dan Williams
cadc56abc8 netlink: loosen sender checks to allow other multicast messages
We need the IFLA_PROTINFO messages, and these are apparently sent
(still by the kernel) but with our own PID.  So the current checks
that limit the netlink PID to zero block these messages out. Instead
(like udev) we should be checking the actual sender of the message
usign unix socket credentials.

Second, at least at this point only privileged processes can send
netlink multicast messages, so as long as the:

* the other end of the socket is UID 0 AND
   * the netlink PID is 0 OR
   * the message is multicast and sent to our netlink PID

the we accept the message and process it as normal.  For another
example of this, see 'netlink.c' from the dhcp6s program; do a
Google search for "IFLA_PROTINFO" to find it.
2010-04-20 15:22:36 -07:00