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
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 expires
libsystemd
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
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
---
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
+++
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
patrik.fl...@linux.intel.com wrote:
---
src/libsystemd-network/test-dhcp-client.c | 16
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_REQUESTING)
+
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,
Patrik
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
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.
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.
Applied
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-devel@lists.freedesktop.org
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
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
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
On Thu, 2014-05-29 at 00:03 +0100, Tom Gundersen wrote:
On Wed, May 28, 2014 at 7:43 PM, Camilo Aguilar
camilo.agui...@gmail.com 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
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);
+ if (r 0)
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 it was
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
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
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
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
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,
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
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 +-
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
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 |
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
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
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.,
From: Tom Gundersen t...@jklm.no
---
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
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
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
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 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 +
Updated the start function so that the client state can be conveniently
changed with the previous message resend timers cleared. On initial
startup also create and bind to the UDP socket.
---
src/libsystemd-network/sd-dhcp6-client.c | 62 +---
1 file changed, 42
Provide functions to bind the ICMPv6 socket to the approriate interface
and set multicast sending and receiving according to RFC 3493, section
5.2. and RFC 3542, sections 3. and 3.3. Filter out all ICMPv6 messages
except Router Advertisements for the socket in question according to
RFC 3542,
messaging
going back and forth between the client and the server.
Have fun while reviewing,
Patrik
Patrik Flykt (22):
sd-dhcp6-client: Add initial DHCPv6 client files
sd-dhcp6-client: Add Router Solicitation and Advertisement support
sd-dhcp6-client: Add initial Router
Add test cases for basic DHCPv6 client handling, e.g. setting
interface index, mac address and attaching event loop.
---
Makefile.am| 13 -
src/libsystemd-network/test-dhcp6-client.c | 76 ++
2 files changed, 88 insertions(+), 1
From: Tom Gundersen t...@jklm.no
Initialize DHCP Unique Identifier when creating the client. The
DUID is generated based on the machine-id, which satisfies all the
requirements of what an DUID should be. The DUID type is DUID-EN.
Based on patch by Patrik Flykt.
---
src/libsystemd-network/sd
Enhance the test case by generating a Reply. With a properly formed
Reply the callback function will be called and the additional
earlier event loop exit can now be removed.
---
src/libsystemd-network/test-dhcp6-client.c | 45 ++
1 file changed, 40 insertions(+), 5
Hi,
On Fri, 2014-06-13 at 12:17 -0500, Dan Williams wrote:
1) usage of struct ether_addr may prevent correct operation on
non-ethernet links, like Infiniband or PPP or GRE. They don't have
6-byte MAC addresses, so anywhere that currently uses a MAC address I'd
suggest passing u8*,
Hi,
On Wed, 2014-06-18 at 15:50 +0200, Zbigniew Jędrzejewski-Szmek wrote:
+if (!client-retransmit_time) {
+client-retransmit_time =
+
client_timeout_compute_random(init_retransmit_time);
+} else {
+if
On Wed, 2014-06-18 at 16:25 +0200, Zbigniew Jędrzejewski-Szmek wrote:
On Wed, Jun 18, 2014 at 07:05:35AM -0700, Filipe Brandenburger wrote:
On Wed, Jun 18, 2014 at 6:58 AM, Zbigniew Jędrzejewski-Szmek
zbys...@in.waw.pl wrote:
+if (client-fd 0)
+
On Wed, 2014-06-18 at 16:27 +0200, Zbigniew Jędrzejewski-Szmek wrote:
Go ahead and push. It is probably simpler to make further
suggestions/comments in terms of patches anyway.
Agreed. I made some small comments, but the patch set looks great.
Patch set fixed according to your comments
On Wed, 2014-06-18 at 16:27 +0200, Zbigniew Jędrzejewski-Szmek wrote:
Go ahead and push. It is probably simpler to make further
suggestions/comments in terms of patches anyway.
Agreed. I made some small comments, but the patch set looks great.
Polished a bit more and pushed, enjoy!
Cheers,
is done in patch 07, seems that the DHCP server I'm using
doesn't want to rapid commit anything here, perhaps due to a missing
IPv6 address to request or something.
Last but not least the TODO file lists a few items that are left for
later.
Cheers,
Patrik
Patrik Flykt (8):
sd-dhcp6
When a link fails or looses carrier, always stop ongoing router
solicitation and any DHCPv6 client that may be running.
---
src/network/networkd-link.c | 14 +++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
Provide a function to request more options from the DHCPv6 server.
Provide a sensible default set at startup and add test basic test
cases for the intended usage.
Define DNS and NTP related option codes and add comments for the
unassigned codes.
---
src/libsystemd-network/dhcp6-protocol.h|
Create a helper function to compute the remaining time in seconds from
time T2 to the IPv6 address with the longest lifetime. The computed
time is used as the Maximum Retransmission Duration in Rebinding state.
See RFC 3315, section 18.1.4. for details.
---
In some use cases stopping an ongoing ICMPv6 discovery is more
useful than always unreferencing the whole structure.
---
src/libsystemd-network/sd-icmp6-nd.c | 13 +
src/libsystemd-network/test-icmp6-rs.c | 4
src/systemd/sd-icmp6-nd.h | 1 +
3 files changed, 18
Start sending Renew and Rebind DHCPv6 messages when respective timers T1
and T2 expire. Rebind messages do not include a Server ID option and the
Rebind procedure ends when the last IPv6 address valid lifetime expires,
whereafter the client restarts the address acquisition procedure by
Soliciting
In order to keep the refcounting working, a DONT_DESTROY macro similar
to the one in sd-bus has been added also to DHCPv6.
---
src/libsystemd-network/sd-dhcp6-client.c | 37 +++-
1 file changed, 17 insertions(+), 20 deletions(-)
diff --git
---
TODO | 16
1 file changed, 16 insertions(+)
diff --git a/TODO b/TODO
index a5f482b..8d8d694 100644
--- a/TODO
+++ b/TODO
@@ -624,6 +624,22 @@ Features:
- export timezone information
- FORCERENEW
+* dhcp6:
+ - add functions to set previously stored IPv6 addresses
On Thu, 2014-06-26 at 12:59 +0200, Zbigniew Jędrzejewski-Szmek wrote:
+if (!GREEDY_REALLOC(client-req_opts, client-req_opts_allocated,
+(client-req_opts_len + 1) * sizeof(option)))
+return -ENOMEM;
GREEDY_REALLOC takes the number of
On Thu, 2014-06-26 at 13:01 +0200, Zbigniew Jędrzejewski-Szmek wrote:
+*expire = 0;
+
+LIST_FOREACH(addresses, addr, ia-addresses) {
+t = be32toh(addr-lifetime_valid);
+if (*expire t)
+*expire = t;
+}
On Thu, 2014-06-26 at 14:07 +0200, Zbigniew Jędrzejewski-Szmek wrote:
No comments, the rest looks great, as usual. I think you can push it.
Thanks. And pushed.
Cheers,
Patrik
___
systemd-devel mailing list
On Thu, 2014-06-26 at 13:24 +0300, Patrik Flykt wrote:
With this patch set it looks like basic DHCPv6 client functionality
should be covered as Renew and Rebind are now also handled.
Patch set updated according to Zbyszek's comments and pushed.
Cheers,
Patrik
---
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..26857b6
--- /dev/null
Add maximum message size option to keep some DHCP server implementations
from sending too big messages. See ConnMan commit
0c5c862749c05193cf4c513628328c6db02b5222.
---
src/dhcp/client.c | 10 ++
src/dhcp/protocol.h |1 +
2 files changed, 11 insertions(+)
diff --git
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.
---
src/dhcp/internal.h |2 ++
src/dhcp/network.c | 63
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.
---
src/dhcp/client.c | 77
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
Create a new directory to host DHCP components.
---
src/dhcp/protocol.h | 93 +++
1 file changed, 93 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
The client test program is the only one to be built so far.
---
Makefile.am | 15 +++
configure.ac |9 +
src/dhcp/Makefile |1 +
3 files changed, 25 insertions(+)
create mode 12 src/dhcp/Makefile
diff --git a/Makefile.am b/Makefile.am
index
The test program runs the DHCP protocol using libsystemd-dhcp.
---
src/dhcp/dhcp-example-client.c | 112
1 file changed, 112 insertions(+)
create mode 100644 src/dhcp/dhcp-example-client.c
diff --git a/src/dhcp/dhcp-example-client.c
---
Makefile.am | 10 ++
1 file changed, 10 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 1c73423..f079822 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3760,6 +3760,12 @@ libsystemd_dhcp_la_LDFLAGS = \
libsystemd_dhcp_la_LIBADD = \
libsystemd-shared.la
---
Makefile.am | 10 ++
src/dhcp/test-dhcp-option.c | 16 +++-
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index cc52f01..aeca484 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3740,6 +3740,15 @@ endif
#
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.
---
src/dhcp/client.c | 137 +
client
code running as normally as possible.
A very small example client is also created, I used it to watch the client-
server interaction via Wireshark.
Please review and comment,
Patrik
Patrik Flykt (28):
dhcp: Add DHCP protocol structures and initial defines
dhcp: Add DHCP client
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
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 | 123 ++-
src/dhcp/protocol.h |2 +
2 files changed, 124 insertions(+), 1 deletion(-)
diff
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 their
---
Makefile.am |6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index f079822..433383d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3758,7 +3758,8 @@ libsystemd_dhcp_la_LDFLAGS = \
$(AM_LDFLAGS)
libsystemd_dhcp_la_LIBADD = \
-
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
---
src/dhcp/client.c | 11 +++
src/dhcp/client.h |2 ++
2 files changed, 13 insertions(+)
diff --git a/src/dhcp/client.c b/src/dhcp/client.c
index 0144c70..a274549 100644
--- a/src/dhcp/client.c
+++ b/src/dhcp/client.c
@@ -994,6 +994,17 @@ int dhcp_client_stop(DHCPClient *client)
Create an initial simple test program for these two cases.
---
src/dhcp/test-dhcp-option.c | 54 +++
1 file changed, 54 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
---
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 26857b6..94f576a 100644
--- a/src/dhcp/test-dhcp-client.c
+++ b/src/dhcp/test-dhcp-client.c
@@ -22,6
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
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.
---
src/dhcp/client.c | 145
---
Makefile.am | 20
1 file changed, 20 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index aeca484..5c350ab 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3740,6 +3740,26 @@ endif
#
--
The client is stopped and brought back to its initial state.
---
src/dhcp/client.c | 35 +++
src/dhcp/client.h |1 +
2 files changed, 36 insertions(+)
diff --git a/src/dhcp/client.c b/src/dhcp/client.c
index dc92880..79ac93b 100644
--- a/src/dhcp/client.c
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
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 | 98 -
src/dhcp/client.h |9 +
2 files changed, 106 insertions(+), 1 deletion(-)
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 | 71 +++
1 file
Hi,
On Wed, 2013-11-13 at 17:39 +0100, Tom Gundersen wrote:
I'm sure I would like avoid that :) Hopefully we'll be able to reuse
the dhcp client from connman, but as the work of converting that into
a library has not yet finished I don't know yet exactly how that will
work out.
Hi,
On Thu, 2013-11-14 at 06:31 +0900, Greg KH wrote:
Nice stuff. Where did this code come from, conman? If so, for some
reason I thought that it would be easier to make a library of the
existing conman dhcp code and have both projects use it instead of
forking and having two
Hi,
On Thu, 2013-11-14 at 01:01 +0100, Lennart Poettering wrote:
Hmm, struct in_addr contains nothing but a uint32_t. It really
sounds
overkill allocating such a structure individually on the
stack. Shouldn't this structure be directly inside DHCPClient? Or
actually, do we really
On Thu, 2013-11-14 at 01:06 +0100, Lennart Poettering wrote:
+int __dhcp_option_append(uint8_t **buf, int *buflen, uint8_t code,
+ uint8_t optlen, void *optval);
+
The __ prefix is actually private property by the C compiler,
according to ANSI C. Please do not
On Thu, 2013-11-14 at 01:22 +0100, Lennart Poettering wrote:
Also, rtnl sounds the better option. And if not, then this call
appears
to be totally identical to glibc's ifname_to_index(), no? Better use
that then...
This is only part of the example DHCP test client. It's usefulness is
On Thu, 2013-11-14 at 01:23 +0100, Lennart Poettering wrote:
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
Hi,
On Thu, 2013-11-14 at 01:30 +0100, Lennart Poettering wrote:
+err = sd_event_add_monotonic(sd_event_get(s),
next_timeout,
+ 10 * USEC_PER_MSEC,
+ client_timeout_resend,
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.
---
v2: - previous 24/28
- replace 'err' with 'r' and fix fd as suggested
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
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
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
Create a new directory to host DHCP components.
---
v2: use _packed_, be*_t where appropriate and anonymous enums
src/dhcp/protocol.h | 104 +++
1 file changed, 104 insertions(+)
create mode 100644 src/dhcp/protocol.h
diff --git
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 | 71 +++
1 file
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
1 - 100 of 240 matches
Mail list logo