NetworkManager.git
10 years agoip6: fail if the RA-provided address disappears or RDNSS expires
Dan Williams [Mon, 3 May 2010 10:02:57 +0000]
ip6: fail if the RA-provided address disappears or RDNSS expires

10 years agoip6: don't prematurely remove RDNSS nameservers (rh #588192)
Dan Williams [Mon, 3 May 2010 09:48:18 +0000]
ip6: don't prematurely remove RDNSS nameservers (rh #588192)

10 years agoip6: tune RDNSS parsing logging
Dan Williams [Mon, 3 May 2010 09:42:48 +0000]
ip6: tune RDNSS parsing logging

10 years agocore: better logging for interface address syncing
Dan Williams [Mon, 3 May 2010 09:11:59 +0000]
core: better logging for interface address syncing

10 years agoifcfg-rh: add support for non-fatal IP configuration failure
Dan Williams [Mon, 3 May 2010 08:33:55 +0000]
ifcfg-rh: add support for non-fatal IP configuration failure

10 years agocore: allow selective failure of IP configuration (rh #567978)
Dan Williams [Mon, 3 May 2010 08:19:54 +0000]
core: allow selective failure of IP configuration (rh #567978)

As long as at least one IP config method completes, and as long as
methods that the user required to complete do complete, allow the
connection to complete.

10 years agomesh: let parent class handle IP config timeout
Dan Williams [Mon, 3 May 2010 07:59:06 +0000]
mesh: let parent class handle IP config timeout

10 years agolibnm-util: clarify may-fail behavior
Dan Williams [Mon, 3 May 2010 07:08:02 +0000]
libnm-util: clarify may-fail behavior

10 years agolibnm-util: add 'may-fail' for IPv4 and IPv6
Dan Williams [Sun, 2 May 2010 23:51:26 +0000]
libnm-util: add 'may-fail' for IPv4 and IPv6

When this property is TRUE, IP configuration can continue as long
as at least on IP configuration type succeeds.  This allows
connections to networks where the user does not necessarily know
whether the network supports IPv4 or IPv6 and does not require
that both complete succesfully.

Since most of the time the user doesn't really care what type
of connectivity they have, as long as they have *some* connectivity,
this allows better "Just Works" behavior as long as the system
settings plugins and connection editors/applets use the right
defaults.

Suggested defaults for may-fail are:

IPv4: no (ie, require IPv4 connectivity)
IPv6: yes (ie, do not require IPv6 connectivity)

Users who require a specific type of connectivity are probably
knowlegable enough to check the box as needed for their network.

10 years agolibnm-util: more IPv6 address gateway fixes
Dan Williams [Sun, 2 May 2010 20:22:29 +0000]
libnm-util: more IPv6 address gateway fixes

10 years agoip6: avoid autoconf routes where dest == gateway
Dan Williams [Sun, 2 May 2010 07:44:44 +0000]
ip6: avoid autoconf routes where dest == gateway

These return errors when we try to add them via netlink (both internal
code and using /sbin/ip) so we'll ignore them for now.

10 years agotrivial: remove some debugging leftovers
Dan Williams [Sun, 2 May 2010 07:32:26 +0000]
trivial: remove some debugging leftovers

10 years agodhcp: ensure getting DHCP IP config fails if the client died early
Dan Williams [Sun, 2 May 2010 07:24:50 +0000]
dhcp: ensure getting DHCP IP config fails if the client died early

If the client never delivered any options to NM, make sure we don't
return a valid IP config object to callers when they request one.

10 years agodhcp: handle client early exit correctly
Dan Williams [Sun, 2 May 2010 07:24:40 +0000]
dhcp: handle client early exit correctly

When the client exits it may take a short amount of time for the
dhclient hook script to deliver the options to NetworkManager; so
we need to keep the client object around a bit (so we know what
NMDHCPClient the options getting delivered are for).  If we don't,
the DHCPManager will dispose of the DHCPClient object and then
when the options come in, it can't match up the PID from the
options with the PID of an existing NMDHCPClient.  So put the
clients on a removal timer that keeps them around for a bit before
we let the manager dispose of them.

Since we're keeping the PID around too instead of zeroing it when
the client exits (for the reason above), track whether the client
is really dead yet so we don't indiscriminately kill a random
process that happens to re-use the PID.

10 years agodhcp6: track client mode better and handle info-only early-exit
Dan Williams [Sat, 1 May 2010 17:16:38 +0000]
dhcp6: track client mode better and handle info-only early-exit

Ignore early exits of the client in info-only mode; since there is
no address lease the client doesn't need to stick around after
getting DNS/etc options from the server.

10 years agodhcp: don't reset pid on client exit
Dan Williams [Sat, 1 May 2010 17:12:25 +0000]
dhcp: don't reset pid on client exit

Clients in IPv6 info-only mode may exit after getting a response
from the server, since there are no leases involved in info-only
mode.  To ensure that the client's options are received when the
event comes in (which could be after we get the child watch
callback for the exit) we still need the client's PID.

10 years agodhcp: clean up client spawn return value
Dan Williams [Sat, 1 May 2010 16:53:49 +0000]
dhcp: clean up client spawn return value

10 years agodhcp: simplify option iteration
Dan Williams [Sat, 1 May 2010 16:48:31 +0000]
dhcp: simplify option iteration

Also removes the failure return when the lease isn't bound,
because nothing was respecting the return value anyway.

10 years agodhcp: fix client end state when it exits normally
Dan Williams [Sat, 1 May 2010 16:27:32 +0000]
dhcp: fix client end state when it exits normally

10 years agologging: log DHCP state changes
Dan Williams [Sat, 1 May 2010 16:26:57 +0000]
logging: log DHCP state changes

10 years agodhcp6: fix merging of DHCPv6 config into interface config
Dan Williams [Sat, 1 May 2010 15:12:25 +0000]
dhcp6: fix merging of DHCPv6 config into interface config

If we're doing autoconf + DHCPv6 info-only, we need to combine the
DHCP and IPv6 configuration into the final device configuration.

10 years agodhcp6: info-only requests don't require addresses
Dan Williams [Sat, 1 May 2010 15:10:49 +0000]
dhcp6: info-only requests don't require addresses

They aren't actual leases so an info-only request doesn't return
an address.

10 years agologging: print DHCP client pid in warnings
Dan Williams [Sat, 1 May 2010 15:09:12 +0000]
logging: print DHCP client pid in warnings

10 years agotrivial: IP6Config object cleanups
Dan Williams [Sat, 1 May 2010 15:05:39 +0000]
trivial: IP6Config object cleanups

10 years agoip6: fix log message arguments
Dan Williams [Sat, 1 May 2010 00:33:44 +0000]
ip6: fix log message arguments

10 years agoip6: better logging of IPv6 autoconf process
Dan Williams [Sat, 1 May 2010 00:30:36 +0000]
ip6: better logging of IPv6 autoconf process

10 years agoip6: ensure manager singleton is cleared when disposed
Dan Williams [Sat, 1 May 2010 00:30:11 +0000]
ip6: ensure manager singleton is cleared when disposed

10 years agoip6: initialize IPv6 address config a bit later
Dan Williams [Fri, 30 Apr 2010 23:10:29 +0000]
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.

10 years agoip6: bump the autoconf RA timeout a bit
Dan Williams [Fri, 30 Apr 2010 23:09:36 +0000]
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.

10 years agoip6: 'manual' method doesn't use the IP6 manager
Dan Williams [Fri, 30 Apr 2010 23:09:02 +0000]
ip6: 'manual' method doesn't use the IP6 manager

10 years agoip6: fix manual IP config application
Dan Williams [Fri, 30 Apr 2010 22:49:41 +0000]
ip6: fix manual IP config application

10 years agolibnm-util: fix IPv6 address array -> string transform
Dan Williams [Fri, 30 Apr 2010 22:29:53 +0000]
libnm-util: fix IPv6 address array -> string transform

Only used for debugging, but it's nice to see the actual address
instead of a transform error.

10 years agoRevert "dbus: add Debian D-Bus permission config"
Dan Williams [Fri, 30 Apr 2010 18:44:56 +0000]
Revert "dbus: add Debian D-Bus permission config"

This reverts commit 3d69429a1e6707b5837e79a1d70532e72d0d3324.

Apparently the 'netdev' group rules aren't as widespread anymore
and Debian ships with ConsoleKit by default, and thus can
use at_console.

10 years agodbus: add Debian D-Bus permission config
Dan Williams [Fri, 30 Apr 2010 18:18:12 +0000]
dbus: add Debian D-Bus permission config

From Michael Biebl and the debian packages.

10 years agodhcp: fix superclass type of dhcpcd plugin
Dan Williams [Thu, 29 Apr 2010 18:31:43 +0000]
dhcp: fix superclass type of dhcpcd plugin

From Mikhail Efremov <sem@altlinux.org>

10 years agoexamples: add example printing out all BSSIDs we can see
Dan Williams [Thu, 29 Apr 2010 15:26:28 +0000]
examples: add example printing out all BSSIDs we can see

10 years agoexamples: add example for listing connections
Dan Williams [Thu, 29 Apr 2010 01:39:42 +0000]
examples: add example for listing connections

10 years agoip6: disconnect netlink signal handler on dispose
Dan Williams [Wed, 28 Apr 2010 00:08:06 +0000]
ip6: disconnect netlink signal handler on dispose

10 years agoip6: fix a crash when /proc/sys/net/ipv6/conf/<iface>/* files are not present
Jiří Klimeš [Tue, 27 Apr 2010 13:59:46 +0000]
ip6: fix a crash when /proc/sys/net/ipv6/conf/<iface>/* files are not present

10 years agobuild: default to pppd-2.4.5 plugin dir
Dan Williams [Tue, 27 Apr 2010 06:56:01 +0000]
build: default to pppd-2.4.5 plugin dir

People should be using 2.4.5 now anyway, since it's been out for
quite a while and includes the fixes for the bogus DNS servers.

10 years agoMerge remote branch 'origin/ip6only'
Dan Williams [Tue, 27 Apr 2010 00:33:45 +0000]
Merge remote branch 'origin/ip6only'

10 years agodns: filter duplicates while constructing resolv.conf
Dan Williams [Mon, 26 Apr 2010 23:09:25 +0000]
dns: filter duplicates while constructing resolv.conf

10 years agoip6: move class boilerplate/setup to the bottom
Dan Williams [Mon, 26 Apr 2010 22:04:01 +0000]
ip6: move class boilerplate/setup to the bottom

10 years agoip6: fix autoconf address and route scraping
Dan Williams [Mon, 26 Apr 2010 21:08:10 +0000]
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.

10 years agoip6: correctly handle routes with no gateways
Dan Williams [Mon, 26 Apr 2010 21:06:58 +0000]
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.

10 years agotest: needs -ldl too for logger code
Dan Williams [Mon, 26 Apr 2010 20:51:19 +0000]
test: needs -ldl too for logger code

10 years agolibnm-glib: use max timeout for settings dbus calls
Dan Williams [Mon, 26 Apr 2010 05:48:10 +0000]
libnm-glib: use max timeout for settings dbus calls

These calls may require authentication, and thus could be in-progress
for much longer than the default D-Bus timeout, which is pretty short.

10 years agocore: ignore mobile broadband ethernet devices that aren't usable (rh #585214)
Dan Williams [Sun, 25 Apr 2010 16:52:01 +0000]
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.

10 years agoMerge remote branch 'origin/master' into ip6only
Dan Williams [Sat, 24 Apr 2010 22:09:40 +0000]
Merge remote branch 'origin/master' into ip6only

10 years agopo: update Czech translation (bgo #616630)
Marek Černocký [Sat, 24 Apr 2010 07:15:40 +0000]
po: update Czech translation (bgo #616630)

10 years agopo: update Kannada translation (bgo #616625)
Shankar Prasad [Sat, 24 Apr 2010 07:14:45 +0000]
po: update Kannada translation (bgo #616625)

10 years agopo: update Telugu translation (bgo #616399)
Krishna Babu K [Sat, 24 Apr 2010 07:13:31 +0000]
po: update Telugu translation (bgo #616399)

10 years agocore: first pass of IPv6 routing and DNS update on IP config change
Dan Williams [Sat, 24 Apr 2010 05:11:22 +0000]
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.

10 years agodns: handle IPv6 nameservers more like IPv4 ones
Dan Williams [Sat, 24 Apr 2010 05:08:56 +0000]
dns: handle IPv6 nameservers more like IPv4 ones

10 years agocore: ensure IP stage failure when stuff actually fails
Dan Williams [Sat, 24 Apr 2010 04:52:10 +0000]
core: ensure IP stage failure when stuff actually fails

10 years agocore: assure a valid IPv6 config on timeout success
Dan Williams [Sat, 24 Apr 2010 04:51:09 +0000]
core: assure a valid IPv6 config on timeout success

10 years agocore: don't pointlessly clear IP6 config on success
Dan Williams [Sat, 24 Apr 2010 04:48:16 +0000]
core: don't pointlessly clear IP6 config on success

10 years agocore: prepare for IPv6 routing and DNS stuff
Dan Williams [Fri, 23 Apr 2010 23:37:45 +0000]
core: prepare for IPv6 routing and DNS stuff

10 years agocore: fail connections if IP configuration expires
Dan Williams [Fri, 23 Apr 2010 22:52:09 +0000]
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

10 years agodhcp: add missing DHCPv6 client states
Dan Williams [Fri, 23 Apr 2010 22:30:46 +0000]
dhcp: add missing DHCPv6 client states

10 years agoMerge remote branch 'origin/master' into ip6only
Dan Williams [Fri, 23 Apr 2010 21:34:39 +0000]
Merge remote branch 'origin/master' into ip6only

10 years agoifcfg-rh: fix handling of WEP passphrases (rh #581718)
Dan Williams [Fri, 23 Apr 2010 21:20:10 +0000]
ifcfg-rh: fix handling of WEP passphrases (rh #581718)

ifcfg-rh wasn't updated for WEP passphrases after that capability
got added.  Can't use KEY for passphrases since there's no way
to distinguish some WEP passphrases from some WEP Hex and ASCII
keys, so we use KEY_PASSPHRASE instead.

10 years agocore: don't even bother running IPv4 or IPv6 when they are disabled
Dan Williams [Fri, 23 Apr 2010 19:56:33 +0000]
core: don't even bother running IPv4 or IPv6 when they are disabled

10 years agoifcfg-rh: missing IP4 setting means DHCP
Dan Williams [Fri, 23 Apr 2010 19:55:05 +0000]
ifcfg-rh: missing IP4 setting means DHCP

10 years agoMerge remote branch 'origin/master' into ip6only
Dan Williams [Fri, 23 Apr 2010 19:13:24 +0000]
Merge remote branch 'origin/master' into ip6only

10 years agocore: rearrange version macros a bit
Dan Williams [Fri, 23 Apr 2010 19:12:47 +0000]
core: rearrange version macros a bit

10 years agologging: log NetworkManager version; use distribution version when configured
Jiří Klimeš [Fri, 23 Apr 2010 13:25:32 +0000]
logging: log NetworkManager version; use distribution version when configured

10 years agocore: return valid error to dbus-glib (rh #581794)
Jiří Klimeš [Fri, 23 Apr 2010 11:12:41 +0000]
core: return valid error to dbus-glib (rh #581794)

10 years agosystem-settings: fix loading connection by plugins
Jiří Klimeš [Fri, 23 Apr 2010 10:13:04 +0000]
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.

10 years agowifi: fix B/G band adhoc wifi auto channel selection
Simon Schampijer [Fri, 23 Apr 2010 00:14:33 +0000]
wifi: fix B/G band adhoc wifi auto channel selection

10 years agoMerge remote branch 'origin/master' into ip6only
Dan Williams [Thu, 22 Apr 2010 21:20:24 +0000]
Merge remote branch 'origin/master' into ip6only

10 years agoifcfg-rh: return valid errors to dbus-glib (rh #581794)
Dan Williams [Thu, 22 Apr 2010 21:19:50 +0000]
ifcfg-rh: return valid errors to dbus-glib (rh #581794)

10 years agocore: return valid error to dbus-glib (rh #581794)
Dan Williams [Thu, 22 Apr 2010 19:39:48 +0000]
core: return valid error to dbus-glib (rh #581794)

10 years agocore: ensure errors are dbus-glib accessible (rh #581794)
Dan Williams [Thu, 22 Apr 2010 19:27:31 +0000]
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.

10 years agoip6: fix IPv6 addrconf detection and completion
Dan Williams [Wed, 21 Apr 2010 22:43:34 +0000]
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.

10 years agoip6: make sure IPv6 addrconf is cleaned up correctly
Dan Williams [Wed, 21 Apr 2010 22:20:16 +0000]
ip6: make sure IPv6 addrconf is cleaned up correctly

10 years agocore: use ifindex instead of interface name in a lot of places
Dan Williams [Wed, 21 Apr 2010 21:58:25 +0000]
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.

10 years agonetlink: provide both blocking and nonblocking netlink connections
Dan Williams [Wed, 21 Apr 2010 21:16:07 +0000]
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).

10 years agonetlink: fix checking multicast groups
Dan Williams [Wed, 21 Apr 2010 08:05:08 +0000]
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.

10 years agonetlink: fix group subscription
Dan Williams [Wed, 21 Apr 2010 00:24:49 +0000]
netlink: fix group subscription

10 years agonetlink: merge nm-netlink.c into nm-netlink-monitor.c
Dan Williams [Wed, 21 Apr 2010 00:22:58 +0000]
netlink: merge nm-netlink.c into nm-netlink-monitor.c

10 years agotrivial: netlink header cleanup
Dan Williams [Tue, 20 Apr 2010 23:55:13 +0000]
trivial: netlink header cleanup

10 years agopo: remove dead translatable
Dan Williams [Tue, 20 Apr 2010 23:53:05 +0000]
po: remove dead translatable

10 years agonetlink: fix IPv6 RA flag retrieval
Dan Williams [Tue, 20 Apr 2010 23:46:08 +0000]
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.

10 years agotrivial: remove dead CFLAGS
Dan Williams [Tue, 20 Apr 2010 23:33:55 +0000]
trivial: remove dead CFLAGS

10 years agonetlink: implement generic group subscription
Dan Williams [Tue, 20 Apr 2010 23:32:03 +0000]
netlink: implement generic group subscription

Needed by the IPv6 manager.

10 years agonetlink: s/monitor/self
Dan Williams [Tue, 20 Apr 2010 22:59:50 +0000]
netlink: s/monitor/self

10 years agonetlink: add header part of 6695eb7423cb1393c36740b8ce6a73d9ff6a7ebe
Dan Williams [Tue, 20 Apr 2010 22:59:18 +0000]
netlink: add header part of 6695eb7423cb1393c36740b8ce6a73d9ff6a7ebe

10 years agonetlink: let clients get netlink message for generic parsing
Dan Williams [Tue, 20 Apr 2010 22:54:55 +0000]
netlink: let clients get netlink message for generic parsing

First step on the way to killing the IPv6-specific netlink listener.

10 years agonetlink: move generic GObject stuff to the bottom
Dan Williams [Tue, 20 Apr 2010 22:31:54 +0000]
netlink: move generic GObject stuff to the bottom

10 years agonetlink: loosen sender checks to allow other multicast messages
Dan Williams [Tue, 20 Apr 2010 22:22:36 +0000]
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.

10 years agocore: more netlink monitor cleanup and reorg
Dan Williams [Tue, 20 Apr 2010 17:55:40 +0000]
core: more netlink monitor cleanup and reorg

10 years agocore: simplify netlink monitor code a bit
Dan Williams [Tue, 20 Apr 2010 17:45:01 +0000]
core: simplify netlink monitor code a bit

10 years agopolicy: move hostname/lookup thread operations into separate file
Dan Williams [Mon, 19 Apr 2010 23:59:34 +0000]
policy: move hostname/lookup thread operations into separate file

10 years agologging: logger needs -ldl for dladdr()
Dan Williams [Mon, 19 Apr 2010 23:56:50 +0000]
logging: logger needs -ldl for dladdr()

10 years agokeyfile: fix writing IPv6 addresses with new format
Dan Williams [Mon, 19 Apr 2010 23:55:40 +0000]
keyfile: fix writing IPv6 addresses with new format

10 years agolibnm-util: update IPv6 address property description
Dan Williams [Mon, 19 Apr 2010 22:10:17 +0000]
libnm-util: update IPv6 address property description

10 years agolibnm-util: quiet harmless message in type conversion
Dan Williams [Mon, 19 Apr 2010 22:10:03 +0000]
libnm-util: quiet harmless message in type conversion

10 years agodoc: update settings spec generator for IPv6 address changes
Dan Williams [Mon, 19 Apr 2010 22:07:18 +0000]
doc: update settings spec generator for IPv6 address changes

10 years agolibnm-util: convert from old IP6 address format to new
Dan Williams [Mon, 19 Apr 2010 17:14:44 +0000]
libnm-util: convert from old IP6 address format to new

Ensure it still works correctly if something tries to set the
'addresses' property using the old GType.  Also make sure that
the various IP6 address comparison operations and string conversion
functions handle the gateway.