Commit graph

29 commits

Author SHA1 Message Date
Tore Anderson
eb460b70da dhcp: use /128 as prefix length for IPv6 IA_NA assignments (bgo #656610) (debian #661885)
DHCPv6 IA_NA assignments do not contain a prefix length, they are for a
single address (/128) only. However, the ISC DHCPv6 client incorrectly
assumes IA_NA assignments come with a implicit prefix length of /64, and
passes this incorrect information on to NetworkManager, which adds this
prefix as a on-link route. This will cause communication failures in
certain networks, for example NBMA networks, and in organisations using
longer prefix lengths than /64 for their LANs. For more discussion
regarding this problem, see RFC 5942 section 5.

This patch makes NM ignore the false prefix length attribute provided by
the ISC DHCPv6 client, instead setting it to a /128 (single address) in
all cases. Note that this does not preclude an on-link prefix from being
added by NM if it is being advertised in the correct way, i.e., by
including a Prefix Information Option with the L flag set in an ICMPv6
Router Advertisement.

For what it's worth I've also sent a patch to ISC to change the hard-
coded implicit prefix length value from /64 to /128 in [ISC-Bugs #29468].
2012-05-31 15:47:55 -05:00
Dan Williams
a531f0d4ea dhcp: allow some same-state transitions (rh #801744)
The DHCP code usually ignores dhclient state transitions to the
same state it's currently in.  This turns out to be wrong, since
dhclient will use the same reason code (which NM uses for the
state value) for operations like RENEW and REBIND.  i.e. you'll
see states like this:

BOUND
RENEW (first renew)
RENEW (second renew)
RENEW (third renew)
etc

Therefore to ensure we trigger dispatcher scripts and internal
housekeeping code for renewals we need to make sure we process
these events even though they use the same state as the previous
event.
2012-05-15 22:54:42 -05:00
Dan Williams
a843431236 Revert "dhcp: allow some same-state transitions (rh #810744)"
This reverts commit a5dfb5a482.

Screwed up the bug #.  Dyslexia?  Maybe...
2012-05-15 22:54:14 -05:00
Dan Williams
a5dfb5a482 dhcp: allow some same-state transitions (rh #810744)
The DHCP code usually ignores dhclient state transitions to the
same state it's currently in.  This turns out to be wrong, since
dhclient will use the same reason code (which NM uses for the
state value) for operations like RENEW and REBIND.  i.e. you'll
see states like this:

BOUND
RENEW (first renew)
RENEW (second renew)
RENEW (third renew)
etc

Therefore to ensure we trigger dispatcher scripts and internal
housekeeping code for renewals we need to make sure we process
these events even though they use the same state as the previous
event.
2012-05-15 22:50:36 -05:00
Thomas Bechtold
184d01c27f trivial: set correct log domain in dhcp client
just set the correct log domain
2011-11-01 16:00:36 -05:00
Jiří Klimeš
29a4c359d2 dhcp: fix key for dhcp options without "new_" prefix
There are none at present, but still tmp_key has to be key, not value.
2011-10-20 18:09:42 +02: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
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
Mikhail Efremov
92b58e56f5 dhcp: ensure that dhcp client is exited
On restart ensure that the client we're trying to kill has
actually exited even if it's not our child.
2010-11-19 16:52:55 -06:00
Dan Williams
8b006f331d dhcp: add support for Fedora dhclient RFC3442 routes (rh #639935)
Add support for Fedora's dhclient's built-in RFC3442 classless static
routes format.

Since the Fedora format uses the same name as the dhcpcd format, we
need to refactor a bunch of the code to ensure we can distinguish
between the types.  Do this at runtime now by consolidating the
classless static routes parsing code into the DHCP Client base class
and rework the unit tests so that we can test all variations of the
classless static route parsing code at the same time.

This also fixes a bug with the dhcpcd classless static route
gateway handling that would return the wrong gateway address.

Many thanks to Jiri Popelka from Red Hat for the initial patch
and explanations.
2010-10-21 13:34:40 -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
e780145a8f dhcp4: handle NIS servers and domains 2010-07-16 11:28:39 -07:00
Dan Williams
26312c087e core: simplify DHCP hostname handling
Reduce memory usage by not duplicating the IP4 setting.
2010-06-28 17:17:24 -07:00
Dan Williams
28d2c5592b 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.
2010-05-02 00:24:50 -07:00
Dan Williams
c34cc017ba 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.
2010-05-02 00:24:40 -07:00
Dan Williams
39c2797848 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.
2010-05-01 10:12:25 -07:00
Dan Williams
8398ccba59 dhcp: simplify option iteration
Also removes the failure return when the lease isn't bound,
because nothing was respecting the return value anyway.
2010-05-01 09:48:31 -07:00
Dan Williams
41f3a67092 dhcp: fix client end state when it exits normally 2010-05-01 09:27:32 -07:00
Dan Williams
d1be3793a1 dhcp6: info-only requests don't require addresses
They aren't actual leases so an info-only request doesn't return
an address.
2010-05-01 08:10:49 -07:00
Dan Williams
eaa750dda9 dhcp: add missing DHCPv6 client states 2010-04-23 15:30:46 -07:00
Dan Williams
75e789399c dhcp: update logging 2010-04-06 18:07:18 -07:00
Dan Williams
f5f1da66b5 core: fix auto determination of classful IPv4 address and add testcase (bgo #603098)
The original patch didn't actually fix the main DHCP option code,
just the dhclient leasefile reading code.  Add some testcases for
good measure.
2010-03-01 17:29:15 -08:00
Dan Williams
35c4b97d7d dhcp6: first stab at autoconf otherconf/managed mode support 2010-01-27 16:20:09 -08:00
Dan Williams
fbe413cbcd dhcp: ensure DHCP client is stopped on timeout 2010-01-15 12:50:38 -08:00
Dan Williams
a9e32f3c3b dhcp: add initial DHCPv6 support (managed mode only) 2010-01-14 00:45:10 -08:00
Dan Williams
fe62e59c7e dhcp: add DHCPv6 functionality 2010-01-13 16:51:20 -08:00
Dan Williams
1806235049 dhcp: convert dhcp backends to classes 2010-01-12 22:09:28 -08:00