History log of /haiku/src/servers/net/DHCPClient.cpp
Revision Date Author Comments
# a8b90daa 21-Dec-2021 Adrien Destugues <pulkomandy@pulkomandy.tk>

Fix more problems with DHCP timers

- Number of retries could overflow. If we retry something more than 255
times and it fails, just stop, instead of flooding the network with
bogus requests
- The timeout could also overflow. It was stored in microseconds in a
time_t, which allows a bit more than an hour. This is fine for the
initial timeout (which starts at a few seconds and will go up to 64
seconds), but after that we switch to a slower rate driven by the
"state time". In particular, this can be the lease time, which DHCP
servers may set to several days, or at least easily more than an hour.
- The computaiton of the timeout in the "slow lease" case attempted to
do "not less than a minute", but missed a conversion from microseconds
to seconds so it ended up doing "not less than 60 microseconds"

The combination of all these things means we can end up with a negative
timeout, and we will send a burst of requests without ever stopping,
flooding the network.

Change-Id: I0eb811c90f4a4dd8c9d92bff728bc2bbb52fbd56
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4826
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 77c1611f 18-Oct-2021 Murai Takashi <tmurai01@gmail.com>

net_server: fix wrong type of arguments to formatting function

Pointed out by LGTM

Change-Id: I76c9853d62221718e20b836a27bc0a4253e9a6ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4610
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 9fef538b 15-Mar-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

DHCP: fix timeout handling

We allowed a delay only for few DHCP states. As a result, DHCP requests
would timeout immediately after sending the initial discover, and
moreover the code would then switch to "renew" state, trying to renew
without an assigned address.

The result is a quick succession of DISCOVER and empty REQUEST messages.
Eventually, the server could send us an OFFER as reply to our DISCOVER,
unless it decided that the empty REQUEST means "I'm requesting from
another server", which would lead it to cancelling its lease.

This would only work by luck on unbusy networks unlike the one I'm using
today.

Change-Id: I86905b341dc70f7dbcc780b954005e39e7c39ee0
Reviewed-on: https://review.haiku-os.org/c/1296
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 42080ace 03-Jul-2018 Augustin Cavalier <waddlesplash@gmail.com>

DHCPClient: Tweaks to logging.

* "timeout" is in usecs, so / 1000 and say "msecs" not "secs"
* Debug-log messages that are not for us received while waiting for
a message that is for us. Hopefully this will not flood the syslog
(DHCP renegotiation is, after all, rare), and it might help diagnose
some of the DHCP failures.


# f1361497 25-Mar-2017 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Revert min / max change and set timeout_t nice way

Mixing up seconds and micro-seconds made me do it.


# 3bbff30d 25-Mar-2017 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

DHCP initial timeout 0.25s from 4s

Connecting to wifi is very slow, there are several issues.
Easiest to find and fis is that on my wifi DHCP always took
4s, as first request fails. Still investigating why..
Reducing timeout to 0.25s makes DHCP process fast.

Moved timout handling into its own struct, and changed state
timeout from max(remaing, 60s) to min(remaining, MAX_TIMEOUT)
Not sure about that change, but why would you want a max value
that is at least 60s?


# 2df71589 29-Jul-2015 Adrien Destugues <pulkomandy@gmail.com>

DHCPClient: don't use AI_ADDRCONFIG

* The DHCP Client is the one configuring interfaces, so it makes no
sense to request address resolution for already configured interfaces
only.
* Fixes #12208


# f9ab315e 29-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

DHCPClient: Check return code of SetAddress().

This should break DHCP for everyone it currently works for (according
to our analysis). If it doesn't, we have yet another (set of) bug(s).


# d6f83df4 25-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

servers/net: DHCPClient: Hard-code the message IDs.

Even though C++ should increment the enum for us, since these IDs
are set and used by things outside of this file, we should hard-code
the numbers.

No functional change (or if there is, it means there's a compiler bug
somewhere.)


# 77206143 05-Feb-2015 Axel Dörfler <axeld@pinc-software.de>

Revert "Move getifaddrs to libnetwork again."

This reverts commit 31ea76548a64b232ed10cb444bf84ca1f7e40b0f.

Adrien, please try again without clobbering the otherwise nice
BNetworkInterface API!

Conflicts:
src/kits/network/getifaddrs.cpp


# 31ea7654 20-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

Move getifaddrs to libnetwork again.

* BNetworkInterfaceAddress is moved to libnetwork. It is modified to not
use BNetworkAddress (which is in libbnetapi) and instead use sockaddr
and sockaddr_storage directly. All callers are adjusted to this.
* Some support code is shared between BNetworkInterface and
BNetworkInterfaceAddress, move it to libnetwork but in the BPrivate
namespace.


# 6972b91e 24-Jul-2013 Pawel Dziepak <pdziepak@quarnos.org>

servers/net: Make DHCP client more RFC 2131 compliant

* The client should enter state REBINDING only when RENEWING times
out.
* When in RENEWING or REBINDING state do not give up retrying
unless the lease expires.
* Fix bug sending 2^n DHCP requests at n-th lease renewal.
* Use timeout values and renewal/rebinding times suggested by the
RFC.
* Use different XIDs in subsequent transactions.


# 5f25cf08 19-May-2012 Siarzhuk Zharski <zharik@gmx.li>

Put hostname option into DHCPDISCOVER/DHCPREQUEST if provided by system

If Haiku has the hostname set, inform DHCP server with corresponding
option in DHCPDISCOVER and DHCPREQUEST messages. That should simplify
accessing Haiku hosts by using it's hostname instead of raw addresses.


# 7ca2da76 17-May-2012 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

rand() is used, but srand() was never called.


# b6ba1daa 16-May-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

There is no point trying to request back from DHCP a link-local
auto-configured address...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41538 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0892800f 27-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Implemented INIT-REBOOT DHCP state: as required per DHCP specs,
we now request the last address we got from DHCP server, and only on failure
we fallback on the whole INIT state (discover, collect offer, etc).
This should fix people losing their IP address at each renewal, or far worse,
after the link goes up again.
Closed #7346.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41285 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e65843e8 22-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Revert files that were commit by mistake in previous commit. Sorry.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41279 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9ff5266f 22-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Avoid deadlock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84fdf2c3 22-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Made _AddressToString() static methods.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41276 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 03f6ab7f 22-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Add dhcp_message::FindOption(), to retrieve a specific option.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41275 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d09c1f8e 22-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Made message retransmission delay +1/-1 randomized as required per RFC2131
spec (see paragraph 4.1)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41273 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ddf57b6c 18-Feb-2011 Axel Dörfler <axeld@pinc-software.de>

* Reverted back to the original version of BNetworkAddress::SetAddress();
in_addr_t is now in network endian again. Thanks, Philippe!
* Made SetToLoopback(), and SetToLocal() a bit more useful (although the latter
isn't implemented yet).
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40552 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cefe2a40 15-Feb-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

* Revert the revert: my local BNetworkAddress::SetAddress(in_addr_t)
was not up-to-date, which leads to a broken fix. Sorry about that.
* Move the details logs to LOG_DEBUG to keep LOG_INFO small.
* Rollback to OPTION_SERVER_ADDRESS, too. Either all options should be
renamed after RFC option names or, as said by axel,
they're named to be understandable, which it was already.

Now, a coffee, please.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40519 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 69b5cacb 15-Feb-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

* BNetworkAddress::SetAddress(in_addr_t) expect a network order value:
revert r40492.
* For semantic sake, use ntoh*() macros to convert data coming from network,
not the hton*() variants, even if the end result is the same.
* Clean and add more details to DHCP syslog messages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40516 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 669afb50 14-Feb-2011 Axel Dörfler <axeld@pinc-software.de>

* This should make DHCP work again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40492 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f76ac724 08-Dec-2010 Axel Dörfler <axeld@pinc-software.de>

* Fixed a typo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39782 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d5d2fdf0 26-Nov-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

* Renamed some option to match more RFC2132 names
* dhcp_message::NextOption() now set cookie.next to NULL on exit if there is no space left
* dhcp_message::Size() now handle OPTION_OVERLOAD case
* Renamed _ToString() to _AddressToString()
* Any error message send by DHCP server will show up in syslog now
* Reorganize DHCPClient::_PrepareMessage() to make more easy to see which
option is added per message type.
* OPTION_SERVER_ADDRESS was always added to DHCP_REQUEST, which MUST NOT
in renewal and rebinding state according RFC 2131.
* add device name to resolver configuration: WIP for #6915...



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39650 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ce36f054 24-Nov-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Comments polishing, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39613 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fb4527d2 24-Nov-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

* Use SetToWildcard() to init the local address.
* Implement OPTION_OVERLOAD support in dhcp_message::NextOption(). Untested.
* Comment out an ASSERT which don't compile in DEBUG mode (and make no sense for me, BTW)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39607 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4ac66051 23-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Improved syslog output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39596 a95241bf-73f2-0310-859d-f6bbb57e9c96


# af074561 23-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Now uses the new network API instead of directly using socket ioctls.
This makes the code much cleaner and simpler.
* Completely untested, though (will do that next).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39595 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 61729d93 28-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Reworked the complete stack to allow more than one address per network
interface - this caused quite a number of changes.
* Network interfaces, and its addresses are now reference counted (not yet
complete, though, InterfaceAddresses need to hold references to their
interface as well).
* There are two known regressions of this commit that I will fix later:
- you cannot remove interfaces anymore
- IPv4 multicast was broken anyway, but now it's disabled, too.
* Moved a device_interfaces.cpp|h out of interfaces.cpp.
* The datalink layer chain is now instantiated per domain per interface,
not just per interface anymore.
* When a buffer reaches the network layer, it has no known interface yet, ie.
the ipv4|6|whatever modules need to set this manually.
* Added more debug output, and some new debugger commands, the control option
is now printed in clear text.
* Added hash_address() function to the address modules. Added "const" to
set_to_defaults() where needed.
* Fixed net_buffer's restore header functions offset use as reported by Atis.
* Improved buffer dump output, use the domain module to print the address if
available.
* Moved net_buffer::type into the union, as it's not needed by the upper layers
anymore.
* Moved IPv6 specific code from {add|remove}_default_route() to where it
belongs, but disabled it for the time being.
* Completely discarded useless ipv4_datagram module.
* Added ping6 to the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37794 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 16e8f13a 11-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Applied patch by Vegard that moves the resolver configuration to where it
belongs (with a few changes by myself). Thanks!
* This closes ticket #5636.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36135 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 37a68cb1 25-Mar-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed kRequiredParameters to kRequestParameters as suggested by Vegard.
* Cleaned up some style issues introduced by Hugo a while back.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35957 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bfd479b3 25-Mar-2010 Axel Dörfler <axeld@pinc-software.de>

* Also request the domain name, patch by Vegard Wærp in ticket #5633.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35956 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c1264353 26-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

My first fix to avoid overwriting resolv.conf was better. Reverted to this code
and clarified the TODO comments. resolv.conf is written again once per
_ParseOptions(), with the DHCP_ACK messages providing the final data.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35954 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 20fb8728 24-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

My commit message in r35940 wasn't quite true, if DHCP_OFFER contained the
name servers, but DHCP_ACK didn't (probably unlikely, but who knows...), then
if DCHP_ACK contained the domain, the name server entries in resolv.conf would
be lost. Now DHCPClient maintains whether resolv.conf should be rewritten and
does so once per _Negotiate() session.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35941 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 538cc414 24-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

* Replaced unsafe zero termination of "data" for names utilizing printf format
trickery.
* Rewrite resolv.conf once per invokation of _ParseOptions() (as before), while
solving the problem that OPTION_DOMAIN_NAME_SERVER and OPTION_DOMAIN_NAME may
appear in arbitrary order.
* Added TODO about how it should be handled eventually. After the changes in
r35938, it should now work as before. The only remaining problem is that if
OPTION_DOMAIN_NAME appears in DHCP_OFFER, but not in DHCP_ACK, the domain
information is lost.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35940 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0f87f52f 23-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Vegard Waerp: Added support for setting the the local domain in the
Network settings and setting the domain if received by DHCP.

Thanks a lot, closes #5619.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35938 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 593a0d2d 03-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Ignore send errors on negotiation, and just try again when they happen.
* This should improve the reliability in case drivers cannot send a packet when
they are still negotiating the line speed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34454 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d77fe260 20-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Added missing "continue" as pointed out by Siarzhuk. Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34153 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b299a6e9 10-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Moved resolv.conf to /boot/common/settings/network/.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33989 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d23fdd96 10-Sep-2009 Oliver Tappe <zooey@hirschkaefer.de>

* DHCPClient now passes communication problems with NetServer on to caller,
as a result failed DHPC-requests will no longer result in bogus static
configurations (but an auto-config IP-address will be picked instead)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33049 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2b829b04 07-May-2009 Bruno G. Albuquerque <bga@bug-br.org.br>

- Fix DHCP client when multiple interfaces are present in the system.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30656 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1a905a76 16-Feb-2009 Axel Dörfler <axeld@pinc-software.de>

* The auto-config looper now correctly sets the IFF_CONFIGURING flag - it
cannot be set in the AF_LINK level.
* It now also checks for this flag, so that the fallback configuration won't
overwrite a manually configured interface anymore.
* When an interface is configured, the IFF_CONFIGURING flag is now cleared as
it should.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29230 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 293ed4fe 27-Dec-2008 Axel Dörfler <axeld@pinc-software.de>

* Pulled an AutoconfigClient class out of DHCPClient - all clients are supposed
to inherit from that one (there is still just a single client, though, this
just simplifies having a generic mechanism to register and use auto-config
clients).
* AutoconfigLooper now listens to link changes, and will reconfigure the
interface if a new link is there - this even seems to work in emulation, will
test on real hardware next.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28827 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 168cc3df 19-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Patch by Adrian Panasiuk: Initialize the renewal time before starting the message runner. This fixes a timing race that would trigger on some DHCP servers and result in constant renewal requests (Ticket #2531). Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28817 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bcc8dada 28-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* dhcp_message::seconds_since_start was set to a negative value, causing
corrupt values. Maybe this changes something with bug #2531.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28749 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 36bde12d 12-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* DHCP now actually uses the new SO_BINDTODEVICE socket option to make sure
the request is sent only on the device it should.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28017 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 15ab0bcf 21-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* int32_t, uint32_t are now of type "int", and no longer of type "long".
This should help to reduce the number of warnings imported code will throw
during compilation (helps a lot with tcpdump, for example).
* Since long is 64 bit on 64 bit platforms, we might want to think about doing
that change for the Haiku types int32 and uint32 as well.
* Fixed several occurences of hidden type problems.
* Fixed build of the stack and TCP under BeOS.
* Fixed incorrect typedef in socket_interface.h.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22643 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f01106c3 11-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Moved the network status replicant into its own application, similar to what
ProcessController and PowerStatus are doing.
* Currently polls for info only - later, the stack should support listeners for
interface related changes.
* Also works under BONE (although it doesn't make much sense to use it there).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20655 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 37c50abf 02-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

net_server: initial replicant version.

* Still picture-less and thus ugly.
* It provides updated information on what the net_server is doing in terms of interface configuration.
* It is also able to show simplistic address information for configured interfaces.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20523 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 65186fec 02-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

Removed duplicated information (the PARAMETER_* constants were already expressed in form
of the OPTION_* constants).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20508 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a073ba1a 01-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

DHCP: since we are only installing routes while handling an OFFER, request gateway in DISCOVER. Fixes an issue where the gateway address is not configured.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20506 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5d4d5313 01-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

DHCP: explicitly request the gateway address and domain name servers to the DHCP server. This fixes an issue some people reported regarding obtaining such information.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20505 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4b661a95 20-Mar-2007 Axel Dörfler <axeld@pinc-software.de>

Fixed a stupid bug that prevented DHCP from trying again if a request was lost
(always happened here with my laptop :-)).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20398 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 46ff5400 13-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* Made the implementation more state driven.
* Now should adhere to the specs with regard to filling the DHCP_REQUEST messages
in BOUND/RENEWAL/REBINDING states.
* Now take over the times for renewal/rebinding state from the DHCP server, if any,
or falls back to 2/3 and 5/6 of the original lease time.
* The lease time was accidently shortened twice (to compute the renewal time, in
case that was missing).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19489 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5782c5a3 13-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* Added support for setting the broadcast address as well (option 28).
* Now prints out the domain name as suggested by DHCP (option 15).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19486 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1a4e8e7b 13-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

Since VMware seems to have some ridiculuous low lease times, I added some code
that prints out the renewal/rebinding times as well - maybe those should be
preferred when they are there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19484 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6cc7630f 12-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented lease time renewal.
* The DHCPClient is now added to its looper before doing the negotiation, so that
it's BMessenger is already valid.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19478 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a552ec13 12-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* If DHCP reports DNS addresses, we'll now rewrite /etc/resolv.conf for now.
* minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19477 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ef8ff79c 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* A copy and paste bug prevented the gateway to be added (worked before the
previous commit).
* Removed the acceptance of a missing DHCP acknowledge message.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19470 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0cf5e6ac 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

Removed the automatic endian conversion in PutOption() - it was confusing and
the actual cause that my router didn't send an acknowledgement (qemu didn't care) :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19469 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 10cc12da 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

Now delays configuring the interface until we got the DHCP acknowledge message - this
might fix the missing message from my router.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19468 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0ce7725e 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* An interface can now also be configured to be "auto config" (which means DHCP for now).
* Some minor cleanup in the DHCP client.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19465 a95241bf-73f2-0310-859d-f6bbb57e9c96


# df3624c1 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* DHCP will now actually acknowledge a successful negotiation.
* The lease time wasn't printed correctly.
* if the DHCP acknowledge message never comes, we won't try
forever, but will just stop early and assume the IP address
we have is okay (looks like my router doesn't send DHCP_ACK).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19463 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f9af6566 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* Work-in-progress of DHCP - the interface should now be correctly configured.
* Lease times are currently ignored, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19462 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2e31a85d 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

The DHCP message must be send as a link-level broadcast for an unconfigured interface.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19458 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fb81684f 06-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

The beginnings of automatic configuration of network devices using DHCP; this is
currently only triggered when there is no configuration file - it can't be configured
this way yet.
All DHCP currently does is to send a UDP broadcast DHCP discover message. More to come.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19437 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2df71589172c3e758c8e0d8ef12d30583d110b18 29-Jul-2015 Adrien Destugues <pulkomandy@gmail.com>

DHCPClient: don't use AI_ADDRCONFIG

* The DHCP Client is the one configuring interfaces, so it makes no
sense to request address resolution for already configured interfaces
only.
* Fixes #12208


# f9ab315e0243a142c9728e357dd82f048e7a4f0c 29-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

DHCPClient: Check return code of SetAddress().

This should break DHCP for everyone it currently works for (according
to our analysis). If it doesn't, we have yet another (set of) bug(s).


# d6f83df4bb0ac993083f5b94a3fffe7485b6c6fe 25-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

servers/net: DHCPClient: Hard-code the message IDs.

Even though C++ should increment the enum for us, since these IDs
are set and used by things outside of this file, we should hard-code
the numbers.

No functional change (or if there is, it means there's a compiler bug
somewhere.)


# 7720614300ff86e823735adcb96690c822dd60f8 05-Feb-2015 Axel Dörfler <axeld@pinc-software.de>

Revert "Move getifaddrs to libnetwork again."

This reverts commit 31ea76548a64b232ed10cb444bf84ca1f7e40b0f.

Adrien, please try again without clobbering the otherwise nice
BNetworkInterface API!

Conflicts:
src/kits/network/getifaddrs.cpp


# 31ea76548a64b232ed10cb444bf84ca1f7e40b0f 20-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

Move getifaddrs to libnetwork again.

* BNetworkInterfaceAddress is moved to libnetwork. It is modified to not
use BNetworkAddress (which is in libbnetapi) and instead use sockaddr
and sockaddr_storage directly. All callers are adjusted to this.
* Some support code is shared between BNetworkInterface and
BNetworkInterfaceAddress, move it to libnetwork but in the BPrivate
namespace.


# 6972b91e17f19950fbf994033846a856bff4b796 24-Jul-2013 Pawel Dziepak <pdziepak@quarnos.org>

servers/net: Make DHCP client more RFC 2131 compliant

* The client should enter state REBINDING only when RENEWING times
out.
* When in RENEWING or REBINDING state do not give up retrying
unless the lease expires.
* Fix bug sending 2^n DHCP requests at n-th lease renewal.
* Use timeout values and renewal/rebinding times suggested by the
RFC.
* Use different XIDs in subsequent transactions.


# 5f25cf08b3f018456f117c6b7bdabb9f46efc4d0 19-May-2012 Siarzhuk Zharski <zharik@gmx.li>

Put hostname option into DHCPDISCOVER/DHCPREQUEST if provided by system

If Haiku has the hostname set, inform DHCP server with corresponding
option in DHCPDISCOVER and DHCPREQUEST messages. That should simplify
accessing Haiku hosts by using it's hostname instead of raw addresses.


# 7ca2da76f00eba4af4f50f8cbf3f03872d36c92f 17-May-2012 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

rand() is used, but srand() was never called.


# b6ba1daaacca4c68146e1aa7ebe515f6c7964f10 16-May-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

There is no point trying to request back from DHCP a link-local
auto-configured address...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41538 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0892800f69bcfb0478aeeeb12171d998d2a315af 27-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Implemented INIT-REBOOT DHCP state: as required per DHCP specs,
we now request the last address we got from DHCP server, and only on failure
we fallback on the whole INIT state (discover, collect offer, etc).
This should fix people losing their IP address at each renewal, or far worse,
after the link goes up again.
Closed #7346.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41285 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e65843e8c981b8537e1c0dd1d20c09c6404e5dfb 22-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Revert files that were commit by mistake in previous commit. Sorry.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41279 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9ff5266f3a21c5a8983c4cfacf2442edf3e4f740 22-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Avoid deadlock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84fdf2c3cab367726e10d72d72c30f12baa330da 22-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Made _AddressToString() static methods.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41276 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 03f6ab7fd15a4a6df3d811014900e5a88f04c60c 22-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Add dhcp_message::FindOption(), to retrieve a specific option.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41275 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d09c1f8e8d611332d9f42895f7fccd39b3f3c4e3 22-Apr-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Made message retransmission delay +1/-1 randomized as required per RFC2131
spec (see paragraph 4.1)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41273 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ddf57b6cf65fe40299b8b7140bab10d305b5ce15 18-Feb-2011 Axel Dörfler <axeld@pinc-software.de>

* Reverted back to the original version of BNetworkAddress::SetAddress();
in_addr_t is now in network endian again. Thanks, Philippe!
* Made SetToLoopback(), and SetToLocal() a bit more useful (although the latter
isn't implemented yet).
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40552 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cefe2a40f7a9d9bbd5ea15f8f4e078152eb02b8f 15-Feb-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

* Revert the revert: my local BNetworkAddress::SetAddress(in_addr_t)
was not up-to-date, which leads to a broken fix. Sorry about that.
* Move the details logs to LOG_DEBUG to keep LOG_INFO small.
* Rollback to OPTION_SERVER_ADDRESS, too. Either all options should be
renamed after RFC option names or, as said by axel,
they're named to be understandable, which it was already.

Now, a coffee, please.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40519 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 69b5cacbad77f6b85449ad337f82a88898640abc 15-Feb-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

* BNetworkAddress::SetAddress(in_addr_t) expect a network order value:
revert r40492.
* For semantic sake, use ntoh*() macros to convert data coming from network,
not the hton*() variants, even if the end result is the same.
* Clean and add more details to DHCP syslog messages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40516 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 669afb5012e9155322201ac6f4d5b3478554e634 14-Feb-2011 Axel Dörfler <axeld@pinc-software.de>

* This should make DHCP work again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40492 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f76ac72459889de0c2d93f8f68a904e21973b3bc 08-Dec-2010 Axel Dörfler <axeld@pinc-software.de>

* Fixed a typo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39782 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d5d2fdf0b3ba12e3443dc15222f198f5d1fb2346 26-Nov-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

* Renamed some option to match more RFC2132 names
* dhcp_message::NextOption() now set cookie.next to NULL on exit if there is no space left
* dhcp_message::Size() now handle OPTION_OVERLOAD case
* Renamed _ToString() to _AddressToString()
* Any error message send by DHCP server will show up in syslog now
* Reorganize DHCPClient::_PrepareMessage() to make more easy to see which
option is added per message type.
* OPTION_SERVER_ADDRESS was always added to DHCP_REQUEST, which MUST NOT
in renewal and rebinding state according RFC 2131.
* add device name to resolver configuration: WIP for #6915...



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39650 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ce36f054505bb0b4fb3fa97ca8d8f0d36dc35ef7 24-Nov-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Comments polishing, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39613 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fb4527d22ed870f84912784108cf7d527d4a8241 24-Nov-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

* Use SetToWildcard() to init the local address.
* Implement OPTION_OVERLOAD support in dhcp_message::NextOption(). Untested.
* Comment out an ASSERT which don't compile in DEBUG mode (and make no sense for me, BTW)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39607 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4ac660519e855c9c87c35edcc747c41827e7f79d 23-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Improved syslog output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39596 a95241bf-73f2-0310-859d-f6bbb57e9c96


# af0745618fc4fca86016d858e5ba9dc64dab16ea 23-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Now uses the new network API instead of directly using socket ioctls.
This makes the code much cleaner and simpler.
* Completely untested, though (will do that next).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39595 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 61729d9323a555b9025ef6ebeb85dc1627f8acf7 28-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Reworked the complete stack to allow more than one address per network
interface - this caused quite a number of changes.
* Network interfaces, and its addresses are now reference counted (not yet
complete, though, InterfaceAddresses need to hold references to their
interface as well).
* There are two known regressions of this commit that I will fix later:
- you cannot remove interfaces anymore
- IPv4 multicast was broken anyway, but now it's disabled, too.
* Moved a device_interfaces.cpp|h out of interfaces.cpp.
* The datalink layer chain is now instantiated per domain per interface,
not just per interface anymore.
* When a buffer reaches the network layer, it has no known interface yet, ie.
the ipv4|6|whatever modules need to set this manually.
* Added more debug output, and some new debugger commands, the control option
is now printed in clear text.
* Added hash_address() function to the address modules. Added "const" to
set_to_defaults() where needed.
* Fixed net_buffer's restore header functions offset use as reported by Atis.
* Improved buffer dump output, use the domain module to print the address if
available.
* Moved net_buffer::type into the union, as it's not needed by the upper layers
anymore.
* Moved IPv6 specific code from {add|remove}_default_route() to where it
belongs, but disabled it for the time being.
* Completely discarded useless ipv4_datagram module.
* Added ping6 to the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37794 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 16e8f13a6348d5899cc50506c91f9ce380ed8532 11-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Applied patch by Vegard that moves the resolver configuration to where it
belongs (with a few changes by myself). Thanks!
* This closes ticket #5636.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36135 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 37a68cb1f2efd6510bfc72dad510f29f1a0b6931 25-Mar-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed kRequiredParameters to kRequestParameters as suggested by Vegard.
* Cleaned up some style issues introduced by Hugo a while back.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35957 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bfd479b3b69de945132da30eab4b190885a70fda 25-Mar-2010 Axel Dörfler <axeld@pinc-software.de>

* Also request the domain name, patch by Vegard Wærp in ticket #5633.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35956 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c12643530e76354db6e26662873654ae7e607fc9 26-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

My first fix to avoid overwriting resolv.conf was better. Reverted to this code
and clarified the TODO comments. resolv.conf is written again once per
_ParseOptions(), with the DHCP_ACK messages providing the final data.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35954 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 20fb872810c69be5e9d544781703165e854e0510 24-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

My commit message in r35940 wasn't quite true, if DHCP_OFFER contained the
name servers, but DHCP_ACK didn't (probably unlikely, but who knows...), then
if DCHP_ACK contained the domain, the name server entries in resolv.conf would
be lost. Now DHCPClient maintains whether resolv.conf should be rewritten and
does so once per _Negotiate() session.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35941 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 538cc4144c74bfbe3f200c73c6324d24a2787d77 24-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

* Replaced unsafe zero termination of "data" for names utilizing printf format
trickery.
* Rewrite resolv.conf once per invokation of _ParseOptions() (as before), while
solving the problem that OPTION_DOMAIN_NAME_SERVER and OPTION_DOMAIN_NAME may
appear in arbitrary order.
* Added TODO about how it should be handled eventually. After the changes in
r35938, it should now work as before. The only remaining problem is that if
OPTION_DOMAIN_NAME appears in DHCP_OFFER, but not in DHCP_ACK, the domain
information is lost.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35940 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0f87f52fad88ed6502515def46abca1fcfbb1704 23-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Vegard Waerp: Added support for setting the the local domain in the
Network settings and setting the domain if received by DHCP.

Thanks a lot, closes #5619.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35938 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 593a0d2d9068fbc313e99aa5e59aa5e07f0edd6a 03-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Ignore send errors on negotiation, and just try again when they happen.
* This should improve the reliability in case drivers cannot send a packet when
they are still negotiating the line speed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34454 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d77fe260cbcf993dafe77334159798a761ce033b 20-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Added missing "continue" as pointed out by Siarzhuk. Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34153 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b299a6e9d35f93412db0219951b691d6cc1c40cd 10-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Moved resolv.conf to /boot/common/settings/network/.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33989 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d23fdd96cb0bab7a9cb7c4858f908984ee64bbf0 10-Sep-2009 Oliver Tappe <zooey@hirschkaefer.de>

* DHCPClient now passes communication problems with NetServer on to caller,
as a result failed DHPC-requests will no longer result in bogus static
configurations (but an auto-config IP-address will be picked instead)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33049 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2b829b045f211523957c3adb93e894d1e02dac15 07-May-2009 Bruno G. Albuquerque <bga@bug-br.org.br>

- Fix DHCP client when multiple interfaces are present in the system.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30656 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1a905a762aa791f366d5381ab8fed94bb99c1ea9 16-Feb-2009 Axel Dörfler <axeld@pinc-software.de>

* The auto-config looper now correctly sets the IFF_CONFIGURING flag - it
cannot be set in the AF_LINK level.
* It now also checks for this flag, so that the fallback configuration won't
overwrite a manually configured interface anymore.
* When an interface is configured, the IFF_CONFIGURING flag is now cleared as
it should.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29230 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 293ed4fe5b1e467f2008fa2c0df5c339c989c00d 27-Dec-2008 Axel Dörfler <axeld@pinc-software.de>

* Pulled an AutoconfigClient class out of DHCPClient - all clients are supposed
to inherit from that one (there is still just a single client, though, this
just simplifies having a generic mechanism to register and use auto-config
clients).
* AutoconfigLooper now listens to link changes, and will reconfigure the
interface if a new link is there - this even seems to work in emulation, will
test on real hardware next.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28827 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 168cc3df42ec698e69531f05608047de87684bb9 19-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Patch by Adrian Panasiuk: Initialize the renewal time before starting the message runner. This fixes a timing race that would trigger on some DHCP servers and result in constant renewal requests (Ticket #2531). Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28817 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bcc8dada2c41e4fc46430df2006cbf7ad667f380 28-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* dhcp_message::seconds_since_start was set to a negative value, causing
corrupt values. Maybe this changes something with bug #2531.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28749 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 36bde12db20c9852b6283ccfa0d49e61ffd52da7 12-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* DHCP now actually uses the new SO_BINDTODEVICE socket option to make sure
the request is sent only on the device it should.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28017 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 15ab0bcf01ef7bd7323d9b2da55906bafbb40fd3 21-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* int32_t, uint32_t are now of type "int", and no longer of type "long".
This should help to reduce the number of warnings imported code will throw
during compilation (helps a lot with tcpdump, for example).
* Since long is 64 bit on 64 bit platforms, we might want to think about doing
that change for the Haiku types int32 and uint32 as well.
* Fixed several occurences of hidden type problems.
* Fixed build of the stack and TCP under BeOS.
* Fixed incorrect typedef in socket_interface.h.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22643 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f01106c3cfc01f5706583d75c6d75d3b7cd98b77 11-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Moved the network status replicant into its own application, similar to what
ProcessController and PowerStatus are doing.
* Currently polls for info only - later, the stack should support listeners for
interface related changes.
* Also works under BONE (although it doesn't make much sense to use it there).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20655 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 37c50abfaf936ab1b604a6566b04901a2789ad33 02-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

net_server: initial replicant version.

* Still picture-less and thus ugly.
* It provides updated information on what the net_server is doing in terms of interface configuration.
* It is also able to show simplistic address information for configured interfaces.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20523 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 65186fec5a44b7e80bad390946dfc5cde3b608c0 02-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

Removed duplicated information (the PARAMETER_* constants were already expressed in form
of the OPTION_* constants).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20508 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a073ba1aa8ed596d03b57e49e01d16a088eaa835 01-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

DHCP: since we are only installing routes while handling an OFFER, request gateway in DISCOVER. Fixes an issue where the gateway address is not configured.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20506 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5d4d5313c7abf91e4ed6ad564d32e149e9b2e5ed 01-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

DHCP: explicitly request the gateway address and domain name servers to the DHCP server. This fixes an issue some people reported regarding obtaining such information.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20505 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4b661a956f1d4f25bb7187a8a018375241ce05ab 20-Mar-2007 Axel Dörfler <axeld@pinc-software.de>

Fixed a stupid bug that prevented DHCP from trying again if a request was lost
(always happened here with my laptop :-)).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20398 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 46ff54007d71698788ded180c50f8867ab2df815 13-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* Made the implementation more state driven.
* Now should adhere to the specs with regard to filling the DHCP_REQUEST messages
in BOUND/RENEWAL/REBINDING states.
* Now take over the times for renewal/rebinding state from the DHCP server, if any,
or falls back to 2/3 and 5/6 of the original lease time.
* The lease time was accidently shortened twice (to compute the renewal time, in
case that was missing).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19489 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5782c5a3e2e44bd675eac5092875a5de8f7da7c7 13-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* Added support for setting the broadcast address as well (option 28).
* Now prints out the domain name as suggested by DHCP (option 15).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19486 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1a4e8e7b499f133f107fa0d34cc1da4a5d229053 13-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

Since VMware seems to have some ridiculuous low lease times, I added some code
that prints out the renewal/rebinding times as well - maybe those should be
preferred when they are there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19484 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6cc7630f36e2801c9cfb04571e07431f0d4c1149 12-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented lease time renewal.
* The DHCPClient is now added to its looper before doing the negotiation, so that
it's BMessenger is already valid.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19478 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a552ec1396053105da3b962eb0971b0e8e922612 12-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* If DHCP reports DNS addresses, we'll now rewrite /etc/resolv.conf for now.
* minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19477 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ef8ff79cdb21ff4e05d6f0a69d04f0418990984d 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* A copy and paste bug prevented the gateway to be added (worked before the
previous commit).
* Removed the acceptance of a missing DHCP acknowledge message.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19470 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0cf5e6ac7dac495262ce3a723fd71e6dd9ff7033 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

Removed the automatic endian conversion in PutOption() - it was confusing and
the actual cause that my router didn't send an acknowledgement (qemu didn't care) :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19469 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 10cc12da06b8a621bd91b517257b42dbcd03ddc7 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

Now delays configuring the interface until we got the DHCP acknowledge message - this
might fix the missing message from my router.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19468 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0ce7725e1ce38e95260696fd94feb958b0e8abd4 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* An interface can now also be configured to be "auto config" (which means DHCP for now).
* Some minor cleanup in the DHCP client.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19465 a95241bf-73f2-0310-859d-f6bbb57e9c96


# df3624c10e5961e9c0496230a20e3a21b0f35371 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* DHCP will now actually acknowledge a successful negotiation.
* The lease time wasn't printed correctly.
* if the DHCP acknowledge message never comes, we won't try
forever, but will just stop early and assume the IP address
we have is okay (looks like my router doesn't send DHCP_ACK).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19463 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f9af65667d67cd6f0a9a0cae09f7071268dbde16 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

* Work-in-progress of DHCP - the interface should now be correctly configured.
* Lease times are currently ignored, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19462 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2e31a85d7f8250dee47e00caa34dc9c718c8abd3 11-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

The DHCP message must be send as a link-level broadcast for an unconfigured interface.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19458 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fb81684f819c432b2cdc30db597e08ccd88b5a25 06-Dec-2006 Axel Dörfler <axeld@pinc-software.de>

The beginnings of automatic configuration of network devices using DHCP; this is
currently only triggered when there is no configuration file - it can't be configured
this way yet.
All DHCP currently does is to send a UDP broadcast DHCP discover message. More to come.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19437 a95241bf-73f2-0310-859d-f6bbb57e9c96