Commit graph

42 commits

Author SHA1 Message Date
Martin Jansa
a23f3da669 core: use libnl CFLAGS and LIBS consistently
This patch is used in OpenEmbedded [1] since commit 154bd72b [2][3].

[1] http://www.openembedded.org/
[2] http://cgit.openembedded.org/cgit.cgi/openembedded/log/recipes/networkmanager/networkmanager/0001-respect-libnl-flags-also-in-backends-ip6-manager.patch
[3] http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=154bd72b1ca859afcae5ed4fe99ed611a13a475c

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2011-05-19 15:31:02 -05:00
Dan Williams
5ca747316e ip6: remove useless include 2011-04-05 10:04:57 -05:00
Dan Williams
801beb4b4d ip6: prevent overflows in RDNSS and DNSSL timeout calculations (rh #689291) 2011-04-05 09:58:49 -05:00
Dan Williams
4045a91ab9 ip6: add some comments 2011-04-05 09:58:01 -05:00
Dan Williams
48441ea636 ip6: don't try to process invalid RA nameservers 2011-04-05 09:57:43 -05:00
Dan Williams
fdc2d5ee4f ip6: fix possible use of uninitialized memory 2011-04-05 09:54:52 -05:00
Dan Williams
4ea8fb6d99 trivial: fix format type of ip6 manager logging messages 2011-03-21 13:33:43 -05:00
Dan Williams
d815cb9f33 logging: fix format string/argument disagreement
Now that the logging fixes make format checking actually work, fix
the issues it brings up.
2011-03-19 12:44:14 -05: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
Pierre Ossman
83bc663914 ip6: support for DNS Search List option (bgo #637077)
RFC6101 adds the DNS Search List option to router advertisements. This
allows stateless configuration of suffixes to try when doing DNS lookups.
Make sure we catch these when provided by the kernel and reconfigure
things appropriately.

NOTE: this commit depends on a kernel patch:

http://marc.info/?l=linux-netdev&m=129216173321352&w=2
2010-12-15 17:44:20 -06:00
Pierre Ossman
4e8cb2f193 ip6: restructure RDNSS code to be RFC compliant (bgo #637075)
RFC5006/RFC6106 specifies fairly clearly how to handle multiple RDDNS options.
Unfortunately the previous code didn't deal with this and hence would
misbehave in all but the simplest setups. The new code should be fully
compliant with the following exceptions:

- Router lifetime not respected
- No "sufficient number" management.
- DHCPv6 servers might not be prioritised over RDDNS ones.
2010-12-15 17:37:14 -06:00
Pierre Ossman
8229107589 ip6: rdnss structure needs to be packed (bgo #637075)
The code assumes this structure is packed, so let's make sure it actually is.
2010-12-15 17:30:35 -06:00
Dan Williams
9b2b809aae core: rename NMNamedManager -> NMDnsManager 2010-09-07 22:08:18 -05:00
Dan Williams
0b8ee13ee0 ip6: pad RDNSS server expiry slightly to avoid hiccups (rh #590202)
Pad the DNS server expiry somewhat to give a bit of slack in cases
where one RA gets lost or something (which can happen on unreliable
links like wifi where certain types of frames are not retransmitted).
2010-05-14 09:48:46 -07:00
Dan Williams
3e68d33583 ip6: only honor kernel-provided RA flags if an RA was received (rh #588560)
The kernel apparently caches the value and will send Managed/Other flags
in the newlink message even if the router is no longer reachable and
and RA hasn't been received for a while.  So we need to make sure we
check for IF_RA_RCVD before paying attention to Managed/Other.
2010-05-10 15:19:03 -07:00
Dan Williams
46c5a48ff2 ip6: use IN6_ARE_ADDR_EQUAL not memcmp 2010-05-04 12:45:36 -07:00
Dan Williams
7926b3ca95 ip6: turn RA acceptance off when RAs shouldn't be used (rh #588163)
Make sure we don't inadvertenly let the kernel assign an RA address
when connections that don't allow RA are used.
2010-05-03 03:42:43 -07:00
Dan Williams
10d6bc8d2e ip6: fail if the RA-provided address disappears or RDNSS expires 2010-05-03 03:02:57 -07:00
Dan Williams
c21416e956 ip6: don't prematurely remove RDNSS nameservers (rh #588192) 2010-05-03 02:48:18 -07:00
Dan Williams
670de9b5fb ip6: tune RDNSS parsing logging 2010-05-03 02:42:48 -07:00
Dan Williams
5ca72c78a0 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.
2010-05-02 00:44:44 -07:00
Dan Williams
9f85d3533e ip6: fix log message arguments 2010-04-30 17:33:44 -07:00
Dan Williams
2282f352a4 ip6: better logging of IPv6 autoconf process 2010-04-30 17:30:36 -07:00
Dan Williams
8a59706712 ip6: ensure manager singleton is cleared when disposed 2010-04-30 17:30:11 -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
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
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
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
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
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
ee109b94d9 ip6-manager: update logging 2010-04-07 10:41:53 -07:00
Dan Williams
9e627d1bce trivial: rename some CamelCase source files to not-camel-case 2010-03-02 15:06:14 -08:00
Dan Williams
f9bd97020d ipv6: push router advertisement flags to listeners 2010-01-14 22:57:51 -08:00
Dan Williams
4b73cf2421 ipv6: fix incorrect address config signal emission
device->want_signal was never set to TRUE when addrconf was started,
causing random netlink events (say for link-local address addition
or removal) to trigger the config-changed signal from
nm_ip6_device_sync_from_netlink() at the wrong time.  This would
cause IPv6 address configuration to look like it succeeded, when
in fact the config timeout was still in-force.  Thus device
activation would proceed if IPv4 was enabled, but a few seconds later
the device would be deactivated due to the still active IPv6
timeout.

So fix that and clarify when the events from the IPv6 manager happen,
and what the want_signal variable is really for.
2009-10-20 11:23:10 -07:00
Dan Williams
23fec8dc72 ip6: save the accept_ra value and re-set it when the device is deactivated 2009-10-19 15:38:21 -07:00
Dan Winship
7344cc186d Add NMIP6Manager to handle IPv6 addrconf
Automatic IPv6 configuration is handled by the kernel, but to
integrate it properly with NetworkManager, we need to watch what the
kernel does to see whether or not it was successful (so that we can
let the user know if there is no IPv6 router present, for example).
NMIP6Manager takes care of this.
2009-08-26 14:37:45 -04:00