Add initial structure definition and functions for setting index, MAC
address, callback and event loop. Define protocol values and states.
---
src/libsystemd-network/dhcp6-protocol.h | 104
src/libsystemd-network/sd-dhcp6-client.c | 203 +++
src/system
Receive and parse a Reply from the server. Set up T1 and T2 timers and
notify the library user of an acquired DHCPv6 lease.
---
src/libsystemd-network/dhcp6-protocol.h | 1 +
src/libsystemd-network/sd-dhcp6-client.c | 145 +++
src/systemd/sd-dhcp6-client.h
Implement the initial functionality used for creating a DHCPv6 Solicit
message containing the needed options and send it to the DHCPv6
broadcast address. Increase the sent message count and ensure that
the Solicit Initial Retransmission Time is strictly greater than
the Solicitation IRT as describe
Create structures describing Identity Association IDentifiers and
IPv6 lease addresses.
[tomegun: initialize the IAID when client is started. Base this off of the
predictable udev names, if available, as these satisfy the requirement of
the IAID, and base it off the mac addres otherwise, as that i
Add support functions for accessing the current client lease as well
as iterating over the addresses and get their preferred and valid
lifetimes.
---
src/libsystemd-network/dhcp6-lease-internal.h | 2 ++
src/libsystemd-network/sd-dhcp6-client.c | 12 +
src/libsystemd-network/sd-dhcp6
As described in RFC 3315, Section 17.1.2, a client has to wait until the
first timeout has elapsed before it is allowed to request IPv6 addresses
from the DHCPv6 server. This is indicated by a non-NULL lease and a
non-zero resend count. Should the Advertisement contain a preference
value of 255 or
Copy Router Advertisement functions and data from the previous
test case and verify the created Solicit message. The test will
take some non-trivial time to run due to the DHCPv6 initial delay.
---
Makefile.am| 1 +
src/libsystemd-network/test-dhcp6-client.c | 181
Enhance the test case by replying with an Advertise message to the
client. Copy the transaction id, IAID and DUID from the Solicit
message. Verify the Request message created by the DHCPv6 client
implementation and move the main loop exit to the end of the Request
message verification.
Provide loc
When receiving DHCPv6 messages, discard the ones that are not meant
for DHCPv6 clients and verify the transaction id. Once that is done,
process the Advertise message and select the Advertise with the
highest preference.
Create a separate function for lease information parsing so that it
can be re
From: Tom Gundersen
---
src/libsystemd-network/network-internal.c | 26 +++---
src/libsystemd-network/network-internal.h | 1 +
2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/libsystemd-network/network-internal.c
b/src/libsystemd-network/network-interna
Enable DHCPv6 support by creating a DHCPv6 boolean in the Network
section. Add necessary dhcp6 structures and initial function calls.
---
src/network/networkd-link.c | 75
src/network/networkd-network-gperf.gperf | 1 +
src/network/networkd.h
Add the core of DHCPv6 client message retransmission and upper bound
timer and message count handling according to RFC 3315 Secions 7.1.2
and 14. Omit the DHCPv6 initial delay; for now it is assumed that
systemd-networkd will provide decent startup randomization that will
desynchronize the clients.
Add option appending and parsing. DHCPv6 options are not aligned, thus
the option handling code must be able to handle options starting at
any byte boundary.
Add a test case for the basic option handling.
---
Makefile.am| 4 +-
src/libsystemd-network/dhcp6-intern
Add a basic test case excersising once more option parsing function
in addition to lease handling. Check that the address iteration
functions return the correct IPv6 address and lifetimes and that
only one address is returned. Also verify that the server ID and
preference values are read correctly.
Add functionality to parse DHCPv6 Identity Association for
Non-temporary (IA_NA) and Temporary Addresses (IA_TA) options.
Both of them contain one or more IA Address (IAADDR) options
and optinally a status code option. Only the IA_NA option
contains lease lifetimes. See RFC 3315, sections 22.4., 22
Add a function that creates a UDP socket bound to the given interface
and optionally to an IPv6 address. Add another function that will
send the DHCPv6 UDP packet to its destination.
Using IPV6_PKTINFO in setsockopt to bind the IPv6 socket to an
interface is documented in section 4. of RFC 3542, "
Try DHCPv6 if router solicitation times out as a link without routers
may use DHCPv6 according to RFC 4862 section 5.5.2.
---
src/libsystemd-network/sd-dhcp6-client.c | 70 +++-
src/systemd/sd-dhcp6-client.h| 1 +
2 files changed, 69 insertions(+), 2 deleti
Create a structure describing a DHCPv6 lease. Add internal functions
for creating a new lease and accessing the server ID, preference and
IAID. Provide functions for clearing addresses and associated timers.
External users are initially given only the capabilities of
referencing and unreferencing
Feed a Router Advertisement to the code and expect proper events
each time. The sending part is ignored, as all of it is static code
in the real dhcp_network_icmp6_send_rs() function.
---
Makefile.am| 13 ++-
src/libsystemd-network/test-dhcp6-rs.c | 155 +++
On Fri, 2014-05-30 at 17:21 +0100, Tom Gundersen wrote:
> I'm wondering if the criterion should be to request broadcast if and
> only if we have not configured an IP address (I.e. only in
> discovering, requesting and init-reboot), as that seems to be the
> problem, or did I get that wrong?
Yes, I
On Fri, 2014-05-30 at 17:42 +0100, Tom Gundersen wrote:
> > Actually, I have had recent reports from users that there seems to
> exist
> > a category of networking devices
>
> Do you have any more info on this by any chance? Any way we may
> classify these devices in a robust way?
Unfortunately i
On Thu, 2014-05-29 at 18:18 +0100, Tom Gundersen wrote:
> + if (link->udev_device) {
> + const char *l2;
> +
> + l2 = udev_device_get_sysattr_value(link->udev_device, "layer2");
> + if (l2) {
> + unsigned layer2;
> +
> + r = safe_atou(l2, &layer2);
> +
On Thu, 2014-05-29 at 00:03 +0100, Tom Gundersen wrote:
> On Wed, May 28, 2014 at 7:43 PM, Camilo Aguilar
> wrote:
> > In systems running on hypervisors this flag needs to be set ON, so offers
> > can reach
> > the virtual machines.
> >
> > For more information please refer to this thread in Core
On Tue, 2014-05-27 at 13:39 +0200, David Herrmann wrote:
> I strongly disagree. One major example is Wifi-P2P which requires a
> DHCP-Server for ad-hoc P2P connections. A network-daemon manages the
> local address-space, so it should also be responsible of assigning
> those ranges to an ad-hoc DHCP
Section 4.4.1 in RFC 2131 says that a DHCP client SHOULD wait a
random time between one and ten seconds to desynchronize DHCP
clients on startup. This is supported such that the application
can optionally set an initial delay of approximately two and eight
seconds or leave the initial value unset r
On Thu, 2014-03-20 at 20:29 +0100, Tom Gundersen wrote:
> My proposal is:
>
> Whenever the MAC address changes under us networkd calls
> sd_{dhcp_client,ipv4ll}_set_mac(), and it is the libs' responsibility
> to then do the right thing.
>
> Currently the libs don't support this and will fail with
On Wed, 2014-03-19 at 13:53 +0200, Patrik Flykt wrote:
> Even though client identifiers SHOULD be treated as opaque objects by
> DHCP servers, follow the recommendation of a hardware type field with
> value 0x01 (ethernet) followed by the hardware address as described in
> RFC 2132.
On Wed, 2014-03-19 at 14:38 +0200, Patrik Flykt wrote:
> Since the length used by options is known, send packets with no
> extra padding.
Applied this patch too.
Cheers,
Patrik
___
systemd-devel mailing list
systemd
Since the length used by options is known, send packets with no
extra padding.
---
Hi,
Discovered that the full buffer was sent out even though the length of
all options would indicate a shorter one. Shave off extra padding from
the packets by properly setting the buffer length.
Cheers,
Even though client identifiers SHOULD be treated as opaque objects by
DHCP servers, follow the recommendation of a hardware type field with
value 0x01 (ethernet) followed by the hardware address as described in
RFC 2132.
---
Hi,
This change "fixes" the DHCP client identifier to use the in
On Mon, 2014-03-17 at 15:08 +0100, Zbigniew Jędrzejewski-Szmek wrote:
> > If there are no more comments, I can probably go ahead and apply
> > these four patches?
>
> Yes, they look fine.
Rebased to latest taking Tom's changes from yesterday into account and
applied these.
Cheers,
Patri
Hi,
On Sat, 2014-03-15 at 03:56 +0100, Zbigniew Jędrzejewski-Szmek wrote:
> On Fri, Mar 14, 2014 at 08:05:10PM +0100, Tom Gundersen wrote:
> > On Thu, Mar 13, 2014 at 12:01 PM, Patrik Flykt
> > wrote:
> > > ---
> > > src/libsystem
On Sat, 2014-03-15 at 04:02 +0100, Zbigniew Jędrzejewski-Szmek wrote:
> This means that I can complain about spelling :) There's no such word
> as "broadcasted". Past tense and adjective are "broadcast".
Yes :-) Spelling fixed.
> > -if (client->state == DHCP_STATE_REQUESTI
before should the previous IP address be acceptable
to the server.
Cheers,
Patrik
Patrik Flykt (4):
libsystemd-network: Export checksum function to test case
libsystemd-network: Add hangcheck timer for DHCP client test
libsystemd-network: Restart DHCP acquisition if the lease exp
---
src/libsystemd-network/test-dhcp-client.c | 16
1 file changed, 16 insertions(+)
diff --git a/src/libsystemd-network/test-dhcp-client.c
b/src/libsystemd-network/test-dhcp-client.c
index cfc75ae..9509eec 100644
--- a/src/libsystemd-network/test-dhcp-client.c
+++ b/src/libsyst
Remove identical checksum function implementation from the test
case code.
---
src/libsystemd-network/dhcp-internal.h| 2 ++
src/libsystemd-network/dhcp-packet.c | 10 +-
src/libsystemd-network/test-dhcp-client.c | 30 +++---
3 files changed, 10 insertions
Init-Reboot is tried if a client IP address has been given when
the DHCP client is started. In Init-Reboot, start by sending a
broadcasted DHCP Request including the supplied client IP address
but without the server identifier. After sending the request,
enter Reboot state.
If a DHCP Ack is receiv
This causes the DHCP client struct initialization and DHCP client
starting to be factored out into functions of their own.
---
src/libsystemd-network/sd-dhcp-client.c | 74 +++--
1 file changed, 52 insertions(+), 22 deletions(-)
diff --git a/src/libsystemd-network/sd-d
---
Minor correction to the news section.
Cheers,
Patrik
NEWS | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
index 4c7fb72..b40d369 100644
--- a/NEWS
+++ b/NEWS
@@ -85,8 +85,8 @@ CHANGES WITH 209:
around the route netlink interface of
Hi,
On Tue, 2014-02-18 at 03:26 +0100, Lennart Poettering wrote:
> Kay, Zbigniew, Tom, David, Patrik, anything left to fix before I roll a
> release? I'd like to roll the release tomorrow (tuesday) or
> wednesday. Please have a closer look and test!
I'm fine with the DHCP state of affair
Upon startup the DHCP library will immediately send a DHCP Discover.
Handle the additional DHCP Discover checking and DHCP Offer sending
in test_addr_acq_recv_discover(). Write a zero UDP checksum, the
received XID and the faked MAC address into place to create a DHCP
message the library can accept
---
src/libsystemd-dhcp/test-dhcp-client.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/src/libsystemd-dhcp/test-dhcp-client.c
b/src/libsystemd-dhcp/test-dhcp-client.c
index f341b3c..32c79eb 100644
--- a/src/libsystemd-dhcp/test-dhcp-client.c
+++ b/src/libsystemd-dhcp/test-dhcp
Add a callback function that will handle the test case specific checking.
---
src/libsystemd-dhcp/test-dhcp-client.c | 38 +++---
1 file changed, 31 insertions(+), 7 deletions(-)
diff --git a/src/libsystemd-dhcp/test-dhcp-client.c
b/src/libsystemd-dhcp/test-dhcp-clien
n the world but should get the work done.
I still have to send these to the mailing list, no word from fd.o yet.
Cheers,
Patrik
Patrik Flykt (3):
libsystemd-dhcp: Add capabilitye to print out test steps
libsystemd-dhcp: Factor out test code for DHCP message verification
libsyst
---
src/libsystemd-dhcp/sd-dhcp-client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libsystemd-dhcp/sd-dhcp-client.c
b/src/libsystemd-dhcp/sd-dhcp-client.c
index 3b7b9f4..1fdc01a 100644
--- a/src/libsystemd-dhcp/sd-dhcp-client.c
+++ b/src/libsystemd-dhcp/sd-dhcp-clien
A checksum field with value zero means no UDP checksum has been
computed for the packet.
---
src/libsystemd-dhcp/sd-dhcp-client.c | 15 ++-
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/libsystemd-dhcp/sd-dhcp-client.c
b/src/libsystemd-dhcp/sd-dhcp-client.c
index
Compute the 'secs' field as seconds since start of lease acquisition
procedure. Start off with a value of zero and increase it only for
each resent DHCP discover message. See the discussion before and
after http://www.ietf.org/mail-archive/web/dhcwg/current/msg05836.html
and Section 3.1 of RFC 2131
Init-Reboot is tried if a client IP address has been given when
the DHCP client is started. In Init-Reboot, start by sending a
broadcasted DHCP Request including the supplied client IP address
but without the server identifier. After sending the request,
enter Reboot state.
If a DHCP Ack is receiv
x27; field is to be updated only with each sent DHCP Discover and
not constantly for each message. The commit message contains a link
to the discussion on the IETF DHC WG mailing list some years ago.
Cheers,
Patrik
Patrik Flykt (6):
libsystemd-dhcp: DNS name option must be a multiple
Go back to Init state independent of the current state the client
is in.
---
src/libsystemd-dhcp/sd-dhcp-client.c | 20 ++--
1 file changed, 2 insertions(+), 18 deletions(-)
diff --git a/src/libsystemd-dhcp/sd-dhcp-client.c
b/src/libsystemd-dhcp/sd-dhcp-client.c
index 7e79dc1..fd
---
src/libsystemd-dhcp/sd-dhcp-client.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libsystemd-dhcp/sd-dhcp-client.c
b/src/libsystemd-dhcp/sd-dhcp-client.c
index 1fdc01a..ffb304d 100644
--- a/src/libsystemd-dhcp/sd-dhcp-client.c
+++ b/src/libsystemd-dhcp/sd-dhcp
On Thu, 2014-01-02 at 16:52 +0100, Tom Gundersen wrote:
> On Thu, Jan 2, 2014 at 4:48 PM, Reindl Harald wrote:
> >
> >
> > Am 02.01.2014 16:41, schrieb Tom Gundersen:
> >> On Thu, Jan 2, 2014 at 4:37 PM, Reindl Harald
> >> wrote:
> >>> the problems are that if someone comes back with his Apple n
On Fri, 2013-12-20 at 09:47 -0800, Marcel Holtmann wrote:
> Hi Tom,
>
> >>> The first seven patches fix a few issues with the current code.
> >>>
> >>> Patch 09 adds DHCP lease renewing support when timer T1 triggers.
> Using
> >>> the UDP socket sending implementation in patch 08, the DHCP lease
, etc options from
the DHCP message(s) is still missing, sorry for that. Also Init-Reboot
state support is missing; adding that functionality can speed up the
address acquisition if the host comes back to a known network where
it still has an unexpired lease.
Please review,
Patrik
Patrik
---
src/libsystemd-dhcp/test-dhcp-client.c |8 +---
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/libsystemd-dhcp/test-dhcp-client.c
b/src/libsystemd-dhcp/test-dhcp-client.c
index 7400cc6..1ff78c1 100644
--- a/src/libsystemd-dhcp/test-dhcp-client.c
+++ b/src/libsystemd-
Expiration of T1 timeout takes the client to the Rebinding state,
where it attempts to renew its lease. Start by opening a DCHP unicast
socket as there now is a proper IP address set.
Compute the resend timer as half of the remaining time down to a
minimum of 60 seconds (RFC2131). Modify DHCP Requ
Reuse existing functionality when adding T2 Rebinding support.
---
src/libsystemd-dhcp/dhcp-client.c | 41 -
1 file changed, 36 insertions(+), 5 deletions(-)
diff --git a/src/libsystemd-dhcp/dhcp-client.c
b/src/libsystemd-dhcp/dhcp-client.c
index 23669c7..a8
Fix off-by-one error and notice that summing may need more than one
round for the result to be in the lower 16 bits.
---
src/libsystemd-dhcp/dhcp-client.c |7 +--
src/libsystemd-dhcp/test-dhcp-client.c |7 +--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src
Factor out common code from timeout T1 handling and starting of
the DHCP client.
---
src/libsystemd-dhcp/dhcp-client.c | 76 +
1 file changed, 34 insertions(+), 42 deletions(-)
diff --git a/src/libsystemd-dhcp/dhcp-client.c
b/src/libsystemd-dhcp/dhcp-client.
---
src/libsystemd-dhcp/dhcp-client.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libsystemd-dhcp/dhcp-client.c
b/src/libsystemd-dhcp/dhcp-client.c
index fe41067..043d574 100644
--- a/src/libsystemd-dhcp/dhcp-client.c
+++ b/src/libsystemd-dhcp/dhcp-client.c
@@ -726,
---
src/libsystemd-dhcp/dhcp-client.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libsystemd-dhcp/dhcp-client.c
b/src/libsystemd-dhcp/dhcp-client.c
index 043d574..18a6e3c 100644
--- a/src/libsystemd-dhcp/dhcp-client.c
+++ b/src/libsystemd-dhcp/dhcp-client.c
@@ -
Create a helper functions setting up an unicast DHCP UDP socket and
sending data. Add function stubs for the test program.
---
src/libsystemd-dhcp/dhcp-internal.h|3 +++
src/libsystemd-dhcp/dhcp-network.c | 38
src/libsystemd-dhcp/test-dhcp-client.c |
When a DHCP Nak is received, return a DHCP_EVENT_NO_LEASE event. If
some other DHCP message is received or an error happens when parsing
options, return -ENOMSG in order to ignore the packet. There may be
more than one server serving the same subnet, each server will send
its Offer to the client.
-
---
src/libsystemd-dhcp/dhcp-client.c | 10 +-
src/libsystemd-dhcp/dhcp-protocol.h |8
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/libsystemd-dhcp/dhcp-client.c
b/src/libsystemd-dhcp/dhcp-client.c
index c0c348c..fe41067 100644
--- a/src/libsystemd-d
This also fixes a minor indentation damage.
---
src/libsystemd-dhcp/dhcp-network.c |7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/libsystemd-dhcp/dhcp-network.c
b/src/libsystemd-dhcp/dhcp-network.c
index 83a3084..3ff2d0b 100644
--- a/src/libsystemd-dhcp/dhcp-net
On Thu, 2013-12-12 at 17:50 +0100, Zbigniew Jędrzejewski-Szmek wrote:
> In the end I made more changes: not only is src/dhcp renamed to
> src/libsystemd-dhcp, but also src/libsystemd-dhcp/*.[ch] to
> src/libsystemd-dhcp/dhcp-*.[ch]. This is because we like to have
> unique names for files, which ma
On Tue, 2013-12-10 at 18:48 +0100, Lennart Poettering wrote:
> I agree with Zbigniew: this should probably be in
> src/libsystemd-dhcp/, so that this is similar to libsystemd-bus/,
> libsystemd-id128/ and so on...
Sent a patch for that, and in the process of creating an account on
freedesktop.org.
On Tue, 2013-12-10 at 02:46 +0100, Lennart Poettering wrote:
> > +uint32_t ciaddr;
> > +uint32_t yiaddr;
> > +uint32_t siaddr;
> > +uint32_t giaddr;
>
> Hmmm, why uin32_t? Shouldn't this be32_t? THis is network byte order,
> right? which is just synoymous to big end
Create an initial simple test program for these two cases.
---
src/dhcp/test-dhcp-option.c | 51 +++
1 file changed, 51 insertions(+)
create mode 100644 src/dhcp/test-dhcp-option.c
diff --git a/src/dhcp/test-dhcp-option.c b/src/dhcp/test-dhcp-option.c
ne
---
Makefile.am | 20
1 file changed, 20 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 5794380..cface06 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3837,6 +3837,26 @@ lib_LTLIBRARIES += \
endif
#
-
Add maximum message size option to keep some DHCP server implementations
from sending too big messages. See ConnMan commit
0c5c862749c05193cf4c513628328c6db02b5222.
---
src/dhcp/client.c | 12
src/dhcp/protocol.h |1 +
2 files changed, 13 insertions(+)
diff --git a/src/dhcp/c
Open a packet socket, create a link level header, send packet and
close socket. Adding it to a separate file makes testing of the
DHCP sending much easier, as the test program can supply any socket
to the DHCP client code.
---
v3: use size_t and set buffer to const
src/dhcp/internal.h |2 ++
Create a function for handling the full IP, UDP and DHCP packet
and tie it to the main loop. Verify IP and UDP headers and checksum.
Creat a new lease structure with using the values supplied in the
DHCP message. Free the lease structure when client is stopped.
Split out socket handling into a cre
Require a main loop to be set when creating a DHCP client. Set up
a timer to resend DHCP Discover messages and add a 0-2 second
delay to the timeout value. Move to state Selecting after successful
sending of a Discover message.
---
v3: take ref on event loop, unref in free function in patch 26/26
---
src/dhcp/client.c| 13 +
src/systemd/sd-dhcp-client.h |1 +
2 files changed, 14 insertions(+)
diff --git a/src/dhcp/client.c b/src/dhcp/client.c
index d93cceb..2a479e4 100644
--- a/src/dhcp/client.c
+++ b/src/dhcp/client.c
@@ -961,6 +961,19 @@ int sd_dhcp_client_
---
src/dhcp/test-dhcp-client.c | 81 +++
1 file changed, 81 insertions(+)
create mode 100644 src/dhcp/test-dhcp-client.c
diff --git a/src/dhcp/test-dhcp-client.c b/src/dhcp/test-dhcp-client.c
new file mode 100644
index 000..cb2f652
--- /dev/null
+++
---
Makefile.am |6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 1b9edf2..cfa9b4b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3855,7 +3855,8 @@ libsystemd_dhcp_la_LDFLAGS = \
$(AM_LDFLAGS)
libsystemd_dhcp_la_LIBADD = \
-
It was noticed by Grant Erickson in ConnMan commit
95e15c09350acf58d4707056ae2614570883ef66 that:
"Certain DHCP servers, such as that implemented in Mac OS X
(< 10.7) for its "Internet Sharing" feature, refuse to issue
a DHCP lease to clients that have not set a non-zero value
in th
---
src/shared/socket-util.h |2 ++
1 file changed, 2 insertions(+)
diff --git a/src/shared/socket-util.h b/src/shared/socket-util.h
index d42a2fe..84ebc30 100644
--- a/src/shared/socket-util.h
+++ b/src/shared/socket-util.h
@@ -27,6 +27,7 @@
#include
#include
#include
+#include
#in
Define a notification callback and events for stopping and client
lease expiry. Add functions to fetch IP parameters from a lease.
---
src/dhcp/client.c| 112 +-
src/systemd/sd-dhcp-client.h | 13 +
2 files changed, 124 insertions(+), 1 de
Create a new directory to host DHCP components.
---
src/dhcp/protocol.h | 104 +++
1 file changed, 104 insertions(+)
create mode 100644 src/dhcp/protocol.h
diff --git a/src/dhcp/protocol.h b/src/dhcp/protocol.h
new file mode 100644
index 000..
Provide functionality for initializing a DHCP client struct, setting
interface index, last used address and additional options to request.
On initialization the most useful options are added by default.
---
v3: fix OOM check, #ifdef in public header, fix struct prefix
src/dhcp/client.c
Add checks for invalid lengths and parameters when using the option
appending function. Add also checks for adding options, see to it
that the resulting array is identical to the array of options added.
---
src/dhcp/test-dhcp-option.c | 72 +++
1 file chan
---
Makefile.am | 10 ++
1 file changed, 10 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 4e13370..5794380 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3837,6 +3837,15 @@ lib_LTLIBRARIES += \
endif
#
---
On starting the client, use the supplied interface mac address and create
a transaction id. Puzzle together an IP/UDP/DHCP Discover message, compute
checksums and send it out as a raw packet.
Create an additional function that constructs default options common to
all DHCP messages.
Set the DHCP C
Compute the default T1 and T2 timer values if they were not set by
the DHCP server. Verify that the values are reasonable.
---
src/dhcp/client.c | 116 ++-
src/dhcp/protocol.h |2 +
2 files changed, 117 insertions(+), 1 deletion(-)
diff --git
Add a structure describing the DHCP file, sname and trailing options
fields. Create a messge holding these fields and call the internal
option parsing function.
In the test callback function verify that only regular options are
passed and figure out which part of the DHCP message is the one that
i
Process a DHCP Ack/Nak in much the same way as an DHCP Offer. Factor
out header verification and process options sent. Add notification
functionality with discrete values for the outcome of the DHCP Ack/
Nak processing.
---
v3: use size_t for length, -ENOMEM for OOM
src/dhcp/client.c|
Create and send a DHCP Request message reusing already existing parts
of the code. This causes factoring out IP and UDP header creation and
moving next timeout calculation to be done every time in the timer
callback function independent of DHCP state. Also add an exponential
part to the timer calcu
The client is stopped and brought back to its initial state.
---
src/dhcp/client.c| 32
src/systemd/sd-dhcp-client.h |1 +
2 files changed, 33 insertions(+)
diff --git a/src/dhcp/client.c b/src/dhcp/client.c
index 665f986..60a1b4c 100644
--- a/sr
Set a fake MAC address and emulate raw packet sending. When the buffer
containing the Discover message is received, check selected IP and
UDP headers and compute IP header and UDP message checksums. Also
send the DHCP message for option parsing and expect a successful
outcome.
---
Makefile.am
The client test program is the only one to be built so far.
---
Makefile.am | 13 +
src/dhcp/Makefile |1 +
2 files changed, 14 insertions(+)
create mode 12 src/dhcp/Makefile
diff --git a/Makefile.am b/Makefile.am
index 7bedd76..4e13370 100644
--- a/Makefile.am
+++ b/
Add functions to append and parse DHCP options. Not all options
are passed to the callback function, the ones not exposed are
pad, end, message type and overload. If indicated by the overload
option, file and sname fields will be examined for more options.
The option functions are internal to DHCP
---
src/dhcp/test-dhcp-client.c | 40
1 file changed, 40 insertions(+)
diff --git a/src/dhcp/test-dhcp-client.c b/src/dhcp/test-dhcp-client.c
index cb2f652..b226d3f 100644
--- a/src/dhcp/test-dhcp-client.c
+++ b/src/dhcp/test-dhcp-client.c
@@ -22,6 +22,7
x27;s still
the same old src/dhcp.
Cheers,
Patrik
Patrik Flykt (26):
dhcp: Add DHCP protocol structures and initial defines
dhcp: Add DHCP client initialization
dhcp: Add test for DHCP client initialization and parameter setting
build: Add initial build support
dhcp: Add optio
On Mon, 2013-11-25 at 23:52 +0100, Lennart Poettering wrote:
> Of course, timer callbacks should only be called once, ence
> ONESHOT mode is the default -- unless you change that explicitly.
>
> If this doesn't solve the issue, I wouldn't be surprised if there was
> still a bug lurking with the sd
If any number of arguments are given, _cleanup_manager_free_ is used
with unitialized memory causing a crash.
---
src/network/networkd.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/network/networkd.c b/src/network/networkd.c
index 1d43361..360afba 100644
--- a/src/ne
Hi,
On Tue, 2013-11-26 at 00:23 +0100, Lennart Poettering wrote:
> On Mon, 25.11.13 09:13, Patrik Flykt (patrik.fl...@linux.intel.com) wrote:
>
> > +static int client_receive_raw_message(sd_event_source *s, int fd,
> > + uint
On Tue, 2013-11-26 at 00:10 +0100, Lennart Poettering wrote:
> On Mon, 25.11.13 09:13, Patrik Flykt (patrik.fl...@linux.intel.com) wrote:
>
> > +int dhcp_network_send_raw_packet(int index, void *packet, int len);
>
> Should be "const void* packet", no?
>
On Tue, 2013-11-26 at 00:26 +0100, Lennart Poettering wrote:
> On Mon, 25.11.13 09:13, Patrik Flykt (patrik.fl...@linux.intel.com) wrote:
>
> > -static int client_receive_offer(DHCPClient *client,
> > -DHCPPacket *offer, int le
101 - 200 of 268 matches
Mail list logo