Re: [systemd-devel] About DNS servers and search domains in Router Advertisements

2017-09-29 Thread Patrik Flykt
Hi, On Fri, 2017-09-22 at 17:07 +0200, Lennart Poettering wrote: > So, of course, people might want arbitrary complex schemes there, but > I'd probably keep it simple at least in the beginning, and try to be > as automatic as possible... > > maybe we should have a structure

[systemd-devel] About DNS servers and search domains in Router Advertisements

2017-09-22 Thread Patrik Flykt
Hi, Now that we have Router Advertisements and are able to also send statically configured DNS servers and DNS search domains, I wonder which set of DNS servers makes most sense to automatically add in Router Advertisements. The current status quo is DHCPv4, where one can configure the

[systemd-devel] [PATCH 03/11] dhcp6-option: Add helper function for fetching IPv6 addresses

2015-07-10 Thread Patrik Flykt
Add a helper function that extracts a block of IPv6 addresses from the provided option data. --- src/libsystemd-network/dhcp6-internal.h | 5 - src/libsystemd-network/dhcp6-option.c | 23 ++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git

[systemd-devel] [PATCH 10/11] network: Add function to serialize an IPv6 address

2015-07-10 Thread Patrik Flykt
--- src/libsystemd-network/network-internal.c | 15 +++ src/libsystemd-network/network-internal.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/libsystemd-network/network-internal.c b/src/libsystemd-network/network-internal.c index d579755..1db7dd2 100644 ---

[systemd-devel] [PATCH 00/11] DHCPv6 DNS and NTP information

2015-07-10 Thread Patrik Flykt
a bit rusty with systemd, some conventions may have changed since last time. Please review, Patrik Patrik Flykt (11): sd-dhcp6-client: Fix unreferencing DHCPv6 lease on client reset sd-dhcp6-client: Save a DHCPv6 lease also with Information Reply dhcp6-option: Add helper function

[systemd-devel] [PATCH 04/11] dhcp6-option: Add helper function for uncompressed domain names

2015-07-10 Thread Patrik Flykt
Add a helper function that extracts a string array of domain names from the provided option data. The domain names are stored uncompressed as defined in Section 8. of RFC 3315. --- src/libsystemd-network/dhcp6-internal.h | 2 ++ src/libsystemd-network/dhcp6-option.c | 54

[systemd-devel] [PATCH 01/11] sd-dhcp6-client: Fix unreferencing DHCPv6 lease on client reset

2015-07-10 Thread Patrik Flykt
When the DHCPv6 client is started by the library user or stopped for any reason, unref the DHCPv6 lease when resetting the DHCPv6 client data structure. This makes the DHCPv6 client always start from a clean state and not keep unnecessary an lease structure around when stopped. If this is not

[systemd-devel] [PATCH 02/11] sd-dhcp6-client: Save a DHCPv6 lease also with Information Reply

2015-07-10 Thread Patrik Flykt
As the lease structure contains interesting information, save it also for the Information Reply. --- src/libsystemd-network/sd-dhcp6-client.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libsystemd-network/sd-dhcp6-client.c

[systemd-devel] [PATCH 07/11] sd-dhcp6: Add support for DHCPv6 NTP Server Option

2015-07-10 Thread Patrik Flykt
Support NTP server and multicast addresses and NTP server domain names as specified in RFC 5908. --- src/libsystemd-network/dhcp6-lease-internal.h | 7 +++ src/libsystemd-network/dhcp6-protocol.h | 6 ++ src/libsystemd-network/sd-dhcp6-client.c | 7 +++

[systemd-devel] [PATCH 06/11] sd-dhcp6: Add support for DHCPv6 DNS Domain Search List option

2015-07-10 Thread Patrik Flykt
Support DHCPv6 DNS search list option as specified in RFC 3646. This option contains a list of DNS search domains encoded without compression as specified in Section 8. of RFC 3315. --- src/libsystemd-network/dhcp6-lease-internal.h | 4 +++ src/libsystemd-network/sd-dhcp6-client.c | 8

[systemd-devel] [PATCH 11/11] network: Save DNS and NTP data for a DHCPv6 link

2015-07-10 Thread Patrik Flykt
Append DNS and NTP data obtained via DHCPv6 when the Link is saved. --- src/network/networkd-link.c | 62 + 1 file changed, 62 insertions(+) diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index dff81a5..2f36abe 100644 ---

[systemd-devel] [PATCH 08/11] sd-dhcp6: Support deprecated SNTP Configuration Option

2015-07-10 Thread Patrik Flykt
Although the SNTP option specified in RFC 4075 has been deprecated, some servers are still sending NTP information with this option. Use the SNTP information provided only if the NTP option is not present. Update the test case as SNTP information is also requested. ---

[systemd-devel] [PATCH 09/11] test-dhcp6-client: Add tests for DNS and NTP options

2015-07-10 Thread Patrik Flykt
Test option setting and getting in test_advertise_option(). Verify that the information provided in DHCPv6 Reply messages is also available in the Information and Solicit callbacks. --- src/libsystemd-network/test-dhcp6-client.c | 63 ++ 1 file changed, 63

[systemd-devel] [PATCH 05/11] sd-dhcp6: Add support for DHCPv6 DNS Recursive Name Server option

2015-07-10 Thread Patrik Flykt
Support DHCPv6 DNS server option as specified in RFC 3646. This option contains a list of IPv6 DNS server addresses. --- src/libsystemd-network/dhcp6-lease-internal.h | 7 - src/libsystemd-network/sd-dhcp6-client.c | 9 ++- src/libsystemd-network/sd-dhcp6-lease.c | 37

Re: [systemd-devel] [PATCH v2] network: Implement fallback DHCPv6 prefix handling for older kernels

2015-05-04 Thread Patrik Flykt
On Fri, 2015-04-10 at 14:03 +0300, Patrik Flykt wrote: Version 2 attempts to resolve IPv6 address assignment issues at run time, first by adding IFA_FLAGS, then without. Hearing no failure reports, this patch has been applied. Cheers, Patrik

Re: [systemd-devel] [PATCH v2] network: Implement fallback DHCPv6 prefix handling for older kernels

2015-04-24 Thread Patrik Flykt
Hi, On Fri, 2015-04-10 at 14:03 +0300, Patrik Flykt wrote: Version 2 attempts to resolve IPv6 address assignment issues at run time, first by adding IFA_FLAGS, then without. Please test with kernels 3.14 and = 3.14. This may be a case of too few people actually using DHCPv6

[systemd-devel] [PATCH] network: Implement fallback DHCPv6 prefix handling for older kernels

2015-04-09 Thread Patrik Flykt
When setting IPv6 addresses acquired by DHCPv6, systemd-networkd sets the IFA_F_NOPREFIXROUTE flag in the IFA_FLAGS netlink attribute. As the flag and the attribute are present starting with Linux 3.14, older kernels will need systemd-network to manage prefix route handling. Support for IFA_FLAGS

Re: [systemd-devel] [PATCH] network: Implement fallback DHCPv6 prefix handling for older kernels

2015-04-09 Thread Patrik Flykt
On Thu, 2015-04-09 at 12:43 +0200, Lennart Poettering wrote: Hmm, in general, we really should try to create the same binaries, regardless if we are built on an old or new kernel. And the binaries should work as good as possible, regardless which kernel version they are running on. But with

Re: [systemd-devel] [PATCH 1/3] sd-rtnl: Always enable IFA_FLAGS

2015-04-08 Thread Patrik Flykt
On Tue, 2015-04-07 at 21:13 +0200, Alexander Sverdlin wrote: But if the backend code for this flag appears first in Linux 3.14 (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=479840ffdbe4), working around the compilation issue (against older uapi headers) will not

Re: [systemd-devel] [PATCH 1/3] sd-rtnl: Always enable IFA_FLAGS

2015-04-07 Thread Patrik Flykt
On Fri, 2015-04-03 at 06:46 +0200, Alexander Sverdlin wrote: Hi! On 25/03/15 14:36, Patrik Flykt wrote: IFA_FLAGS is a discrete value and has no preprocessor #define defined for it. Fix this by always using the value. Seems that fix was not a real fix: CC src/libsystemd/sd

Re: [systemd-devel] [PATCH 3/3] networkd-dhcp6: Do not handle prefix expiry

2015-03-27 Thread Patrik Flykt
On Fri, 2015-03-27 at 12:05 +0100, Tom Gundersen wrote: On Wed, Mar 25, 2015 at 2:37 PM, Patrik Flykt patrik.fl...@linux.intel.com wrote: Expiring prefixes need not be handled anymore as the kernel has been instructed not to create routes for DHCPv6 assigned addresses via

[systemd-devel] [PATCH 1/3] sd-rtnl: Always enable IFA_FLAGS

2015-03-25 Thread Patrik Flykt
IFA_FLAGS is a discrete value and has no preprocessor #define defined for it. Fix this by always using the value. --- src/libsystemd/sd-rtnl/rtnl-types.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libsystemd/sd-rtnl/rtnl-types.c b/src/libsystemd/sd-rtnl/rtnl-types.c index

[systemd-devel] [PATCH 0/3] Let kernel handle prefix expiry

2015-03-25 Thread Patrik Flykt
prefixes and their disappearance can be removed. I did not do that yet, though, as the code may still be useful in the future - let's see. Please review test, Patrik Patrik Flykt (3): sd-rtnl: Always enable IFA_FLAGS systemd-networkd: Use IFA_F_NOPREFIXROUTE with IPv6 addresses networkd

[systemd-devel] [PATCH 2/3] systemd-networkd: Use IFA_F_NOPREFIXROUTE with IPv6 addresses

2015-03-25 Thread Patrik Flykt
The IFA_F_NOPREFIXROUTE flag prevents the kernel from creating new onlink prefixes when a DHCPv6 IPv6 address with a prefix length is set from user space. IPv6 routing will follow the onlink status from Router Advertisment Prefix Information options or any manually set route, which is the correct

[systemd-devel] [PATCH 3/3] networkd-dhcp6: Do not handle prefix expiry

2015-03-25 Thread Patrik Flykt
Expiring prefixes need not be handled anymore as the kernel has been instructed not to create routes for DHCPv6 assigned addresses via the IFA_F_NOPREFIXROUTE flag. --- src/network/networkd-dhcp6.c | 42 +- 1 file changed, 1 insertion(+), 41 deletions(-)

Re: [systemd-devel] slow systemd-networkd DHCP client on wlan0 with systemd v217

2015-02-04 Thread Patrik Flykt
Hi, On Tue, 2015-02-03 at 17:27 +0100, Lennart Poettering wrote: Is the resume event detected somehow in systemd? The kernel unfortunately provides no API for this right now. However, if logind is the one suspending the machine, then it sends out a PrepareForSleep() signal before

Re: [systemd-devel] slow systemd-networkd DHCP client on wlan0 with systemd v217

2015-02-03 Thread Patrik Flykt
On Tue, 2015-02-03 at 11:46 +0100, Lennart Poettering wrote: On Mon, 02.02.15 23:12, Charles Devereaux (syst...@guylhem.net) wrote: Another problem with systemd-networkd is that the lease is not renewed after sleep. This is a basic feature, a laptop is frequently physicially moved,

Re: [systemd-devel] test-dhcp-client failing in mock builds

2015-02-02 Thread Patrik Flykt
Hi, On Sat, 2015-01-31 at 15:48 +0100, Zbigniew Jędrzejewski-Szmek wrote: DHCP CLIENT (0xa71f5099): STARTED on ifindex 42 DHCP CLIENT (0xa71f5099): DISCOVER DHCP CLIENT (0xa71f5099): OFFER DHCP CLIENT (0xa71f5099): REQUEST (requesting) DHCP CLIENT (0xa71f5099): ACK DHCP CLIENT

Re: [systemd-devel] [PATCH v2 0/9] DHCPv6 address assignment

2015-01-26 Thread Patrik Flykt
On Tue, 2015-01-20 at 19:35 +0200, Patrik Flykt wrote: Hi, Here is version 2 updated according to comments. The trivial debug printout removal being too trivial is no longer part of this set. NTP and DNS information I also left off, I think there might have been a few bugs so

[systemd-devel] [PATCH v2 4/9] sd-icmp6-nd: Add helper function to get the IPv6 link MTU

2015-01-20 Thread Patrik Flykt
Update MTU according to the latest value received. --- src/libsystemd-network/sd-icmp6-nd.c | 27 +++ src/systemd/sd-icmp6-nd.h| 2 ++ 2 files changed, 29 insertions(+) diff --git a/src/libsystemd-network/sd-icmp6-nd.c b/src/libsystemd-network/sd-icmp6-nd.c

[systemd-devel] [PATCH v2 1/9] sd-dhcp6-lease: Revise address iteration functions

2015-01-20 Thread Patrik Flykt
Revise the address iteration functions so that one helper function resets the iterator to the start of the address list while the second one fetches addresses one by one. The test case is also updated. --- src/libsystemd-network/sd-dhcp6-lease.c| 26 -

[systemd-devel] [PATCH v2 3/9] sd-icmp6-nd: Add link and prefix structures for ICMPv6

2015-01-20 Thread Patrik Flykt
Each ICMPv6 structure has an interface index and will therefore be associated with an IPv6 link containing a list of of prefixes. --- v2: Keep the check that 'len' is not equal to zero as the option header points to the next option that might not exist One struct CamelCapsed, the other

[systemd-devel] [PATCH v2 5/9] test-icmp6-rs: Add trivial test case for an MTU that is not present

2015-01-20 Thread Patrik Flykt
--- src/libsystemd-network/test-icmp6-rs.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libsystemd-network/test-icmp6-rs.c b/src/libsystemd-network/test-icmp6-rs.c index be64d33..9d50c57 100644 --- a/src/libsystemd-network/test-icmp6-rs.c +++

[systemd-devel] [PATCH v2 8/9] sd-icmp6-nd: Add support for fetching the latest expired prefix

2015-01-20 Thread Patrik Flykt
Keep the expired prefix for the duration of the prefix expiration event and remove it afterwards. --- src/libsystemd-network/sd-icmp6-nd.c | 20 src/systemd/sd-icmp6-nd.h| 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/libsystemd-network/sd-icmp6-nd.c

Re: [systemd-devel] systemd-networkd quietly ignores DHCPv6 leases

2015-01-15 Thread Patrik Flykt
Hi, On Wed, 2015-01-14 at 16:37 +0100, Barbara Lazarowicz-Steube wrote: As you can see in it, having received the RA networkd correctly identifies the local network as managed and fires up the DHCPv6 client. The client then receives a reply from the server and... does absolutely

Re: [systemd-devel] [PATCH] TODO: DHCPv6 Information Request has been implemented

2015-01-14 Thread Patrik Flykt
On Wed, 2015-01-14 at 01:53 +0100, Zbigniew Jędrzejewski-Szmek wrote: Yeah, there's no need to sent this to the mailing list. It is unlikely to be wrong, and even if it it, we can revert or amend. The same for 1/11 in the other series. If it scares you less that way I'll silently apply future

[systemd-devel] [PATCH 01/11] sd-dhcp6-client: Remove unnecessary debug printout

2015-01-13 Thread Patrik Flykt
--- src/libsystemd-network/sd-dhcp6-client.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 017371e..940a606 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++

[systemd-devel] [PATCH 03/11] sd-icmp6-nd: Update Router Advertisement handling

2015-01-13 Thread Patrik Flykt
As the IPv6 prefixes are needed, update the ICMPv6 Router Advertisement code to dynamically allocate a suitably sized buffer. Iterate through the ICMPv6 options one by one returning error if the option length is too big to fit the buffer. --- src/libsystemd-network/sd-icmp6-nd.c | 75

[systemd-devel] [PATCH 00/11] DHCPv6 address assignment

2015-01-13 Thread Patrik Flykt
. Please review, Patrik Patrik Flykt (11): sd-dhcp6-client: Remove unnecessary debug printout sd-dhcp6-lease: Revise address iteration functions sd-icmp6-nd: Update Router Advertisement handling sd-icmp6-nd: Add link and prefix structures for ICMPv6 sd-icmp6-nd: Add helper function

[systemd-devel] [PATCH 06/11] test-icmp6-rs: Add trivial test case for a MTU that is not present

2015-01-13 Thread Patrik Flykt
--- src/libsystemd-network/test-icmp6-rs.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libsystemd-network/test-icmp6-rs.c b/src/libsystemd-network/test-icmp6-rs.c index be64d33..8a42a34 100644 --- a/src/libsystemd-network/test-icmp6-rs.c +++

[systemd-devel] [PATCH 10/11] networkd-dhcp6: Assign DHCPv6 addresses and prefix lengths

2015-01-13 Thread Patrik Flykt
Once IPv6 addresses have been acquired, assign these to the interface with the prefix lengths taken from the ICMPv6 Router Advertisement handling code. The preferred and valid IPv6 address lifetimes are handed to the kernel which will clean up them if not renewed in time. When a prefix announced

[systemd-devel] [PATCH 02/11] sd-dhcp6-lease: Revise address iteration functions

2015-01-13 Thread Patrik Flykt
Revise the address iteration functions so that one helper function resets the iterator to the start of the address list while the second one fetches addresses one by one. The test case is also updated. --- src/libsystemd-network/sd-dhcp6-lease.c| 24 +++

[systemd-devel] [PATCH 07/11] sd-icmp6-nd: Parse ICMPv6 prefix information

2015-01-13 Thread Patrik Flykt
Save each new onlink IPv6 prefix and attach an expiry timer to it. If the prefixes overlap, take the shorter prefix and write a debug message about the event. Once the prefix is resent in a Router Advertisement, update the timer. Add a new event for the expiring prefix. Add two helper functions,

[systemd-devel] [PATCH 04/11] sd-icmp6-nd: Add link and prefix structures for ICMPv6

2015-01-13 Thread Patrik Flykt
Each ICMPv6 structure has an interface index and will therefore be associated with an IPv6 link containing a list of of prefixes. --- src/libsystemd-network/sd-icmp6-nd.c | 99 1 file changed, 99 insertions(+) diff --git a/src/libsystemd-network/sd-icmp6-nd.c

[systemd-devel] [PATCH 09/11] sd-icmp6-nd: Add support for fetching the latest expired prefix

2015-01-13 Thread Patrik Flykt
Keep the expired prefix for the duration of the prefix expiration event and remove it afterwards. --- src/libsystemd-network/sd-icmp6-nd.c | 23 +++ src/systemd/sd-icmp6-nd.h| 2 ++ 2 files changed, 25 insertions(+) diff --git

[systemd-devel] [PATCH 08/11] test-icmp6-nd: Add test cases for prefixes

2015-01-13 Thread Patrik Flykt
Add test cases that feeds an Router Advertisement to the ICMPv6 code and verify that the correct prefix lengths are returned given an IPv6 address. Enhance the prefix verification test by adding a shorter prefix and check that the intended prefix lengths are now updated. ---

[systemd-devel] [PATCH 11/11] sd_dhcp6_lease: Support DNS and NTP options

2015-01-13 Thread Patrik Flykt
Store arrays of found DNS and NTP IPv6 addresses and strings of DNS search domains and NTP host names as specified in RFC 3646 and RFC 5908. --- src/libsystemd-network/dhcp6-internal.h | 3 + src/libsystemd-network/dhcp6-lease-internal.h | 18 src/libsystemd-network/dhcp6-option.c

[systemd-devel] [PATCH 05/11] sd-icmp6-nd: Add helper function to get the IPv6 link MTU

2015-01-13 Thread Patrik Flykt
Update MTU according to the latest value received. --- src/libsystemd-network/sd-icmp6-nd.c | 30 ++ src/systemd/sd-icmp6-nd.h| 2 ++ 2 files changed, 32 insertions(+) diff --git a/src/libsystemd-network/sd-icmp6-nd.c

Re: [systemd-devel] [PATCH] TODO: DHCPv6 Information Request has been implemented

2015-01-13 Thread Patrik Flykt
On Tue, 2015-01-13 at 14:32 +0200, Patrik Flykt wrote: Just a trivial TODO update, I'll push it right away. Patch applied. Patrik ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo

[systemd-devel] [PATCH] TODO: DHCPv6 Information Request has been implemented

2015-01-13 Thread Patrik Flykt
--- Hi, Just a trivial TODO update, I'll push it right away. Cheers, Patrik TODO | 1 - 1 file changed, 1 deletion(-) diff --git a/TODO b/TODO index 1d497b2..3c2c2c9 100644 --- a/TODO +++ b/TODO @@ -792,7 +792,6 @@ Features: - write more test cases - implement and

[systemd-devel] [PATCH 2/6] sd-dhcp6-lease: Return only -EINVAL when a NULL lease is supplied

2014-12-10 Thread Patrik Flykt
Suppyling a NULL lease is not a condition that needs to be asserted, returning -EINVAL is informative enough to the caller. This simplifies calling code and doesn't falsely indicate that something erroneous was attempted. --- src/libsystemd-network/sd-dhcp6-lease.c | 4 +++- 1 file changed, 3

[systemd-devel] [PATCH 4/6] test-dhcp6-client: Add a simple Information Request test case

2014-12-10 Thread Patrik Flykt
Start the DHCPv6 test case by sending an Information Request, verifying the reply and continuing at once with the normal address acquisition procedure. Reuse the DHCPv6 Solicit Reply so that the client code is verified to ignore any erroneously added IPv6 address information. ---

[systemd-devel] [PATCH 1/6] sd-dhcp6-client: Make end of successfull option parsing explicit

2014-12-10 Thread Patrik Flykt
When all DHCPv6 options have been parsed, dhcp6_option_parse() returns -ENOMSG. Explicitely set the return value to indicate success so that later code does not need to take this special value into account. --- src/libsystemd-network/sd-dhcp6-client.c | 5 - 1 file changed, 4 insertions(+), 1

[systemd-devel] [PATCH 3/6] sd-dhcp6-client: Implement Information Request message

2014-12-10 Thread Patrik Flykt
Implement Information Request message according to RFC 3315, section 18.1.5. with the excepion that the first message is not delayed by a random amount. Instead systemd-networkd is supposed to take care of desynchronizing between other clients. Initialize the DHCPv6 client structure in

[systemd-devel] [PATCH 0/6] DHCPv6 Information request

2014-12-10 Thread Patrik Flykt
it back to fetching additional information only is not possible according to RFCs. Please review, Patrik Patrik Flykt (6): sd-dhcp6-client: Make end of successfull option parsing explicit sd-dhcp6-lease: Return only -EINVAL when a NULL lease is supplied sd-dhcp6-client: Implement

[systemd-devel] [PATCH 6/6] networkd-dhcp6: Support ICMPv6 Other information

2014-12-10 Thread Patrik Flykt
When ICMPv6 Other information is received, enable Information request in DHCPv6. If the DHCPv6 client already exists, only update the client if there is a transition from Other to Managed state. --- src/network/networkd-dhcp6.c | 55 1 file changed, 50

[systemd-devel] [PATCH 5/6] networkd-dhcp6: Move ICMPv6 and DHCPv6 configuration to new file

2014-12-10 Thread Patrik Flykt
Handle all aspects of ICMPv6 and DHCPv6 in a file of its own as is done with DHCPv4 and IPv4LL. --- Makefile.am | 1 + src/network/networkd-dhcp6.c | 165 +++ src/network/networkd-link.c | 122 +---

Re: [systemd-devel] systemd-networkd DHCPv6 Prefix Delegation

2014-12-04 Thread Patrik Flykt
On Thu, 2014-12-04 at 03:27 +0100, Tom Gundersen wrote: Patrik, do you have any plans for this? I agree, this is likely something we want. I'm tempted to do something about it. Give me time until mid next week and we'll see what happens. Cheers, Patrik

Re: [systemd-devel] [PATCH] sd-dhcp-client: fix REBOOT state handling

2014-11-19 Thread Patrik Flykt
On Tue, 2014-11-18 at 18:41 +0100, Tom Gundersen wrote: (but cc'ing Patrik just to make sure) RFC 2131: secs 2 Filled in by client, seconds elapsed since client began address acquisition or renewal process. @@ -422,7 +423,15 @@ static int

Re: [systemd-devel] [PATCH] sd-dhcp-client: support non-Ethernet hardware addresses

2014-10-06 Thread Patrik Flykt
On Fri, 2014-10-03 at 10:04 -0500, Dan Williams wrote: sd_dhcp_client_set_mac() does have an 'arp_type' parameter that's cached in the client struct, so that could be changed to: if (client-arp_type == ARPHRD_ETHER) if you'd like. If it's there already, it is a good thing to use. It does

Re: [systemd-devel] [PATCH] sd-dhcp-client: support non-Ethernet hardware addresses

2014-10-03 Thread Patrik Flykt
Hi, On Thu, 2014-10-02 at 20:05 +0200, Tom Gundersen wrote: The DHCPv4 header is the same format no matter what the LL address size, but for non-ethernet the hlen is 0 and the chaddr is zeroed. The BPF is seeded with an hlen of 0 and a valid ETH_ALEN sized buffer of all zeros.

Re: [systemd-devel] [PATCH] sd-dhcp-client: support non-Ethernet hardware addresses

2014-10-03 Thread Patrik Flykt
On Fri, 2014-10-03 at 15:48 +0300, Patrik Flykt wrote: On Fri, 2014-09-26 at 15:15 -0500, Dan Williams wrote: /* RFC2132 section 4.1.1: The client MUST include its hardware address in the ’chaddr’ field, if - necessary for delivery of DHCP reply messages

Re: [systemd-devel] [PATCH 1/3] sd-dhcp6-client: Implement Elapsed Time option

2014-09-10 Thread Patrik Flykt
On Tue, 2014-09-09 at 13:39 +0200, Tom Gundersen wrote: Hi Patrik, These all look good. Please push! Done that. Cheers, Patrik ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org

[systemd-devel] [PATCH 3/3] TODO: Remove Elapsed Time DHCPv6 option as it is done

2014-09-01 Thread Patrik Flykt
--- TODO | 1 - 1 file changed, 1 deletion(-) diff --git a/TODO b/TODO index 221b39f..4aebcc4 100644 --- a/TODO +++ b/TODO @@ -697,7 +697,6 @@ Features: - implement reconfigure support, see 5.3., 15.11. and 22.20. - implement information request, see 1.2. and 18.1.5. - implement

[systemd-devel] [PATCH 1/3] sd-dhcp6-client: Implement Elapsed Time option

2014-09-01 Thread Patrik Flykt
Implement Elapsed Time option as it is defined as MUST in RFC 3315, section 22.9. The elapsed time value is a 1/100th of a second with a max value of 0x, i.e. 655.35 seconds. As the main loop might not be running yet when sd_dhcp6_client_start() is called, fetch the monotonic time directly

[systemd-devel] [PATCH 0/3] Add DHCPv6 Elapsed Time option

2014-09-01 Thread Patrik Flykt
for this option verifies that the option is present and has a proper length. Cheers, Patrik Patrik Flykt (3): sd-dhcp6-client: Implement Elapsed Time option test-dhcp6-client: Add checks for Elapsed Time option TODO: Remove Elapsed Time DHCPv6 option as it is done TODO

[systemd-devel] [PATCH 2/3] test-dhcp6-client: Add checks for Elapsed Time option

2014-09-01 Thread Patrik Flykt
Verify that the Elapsed Time option is present. --- src/libsystemd-network/test-dhcp6-client.c | 32 ++ 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c index

[systemd-devel] [PATCH] test-dhcp6-client: Fix option length

2014-08-29 Thread Patrik Flykt
The whole DHCPv6 test message length was incorrectly used as the length of DHCPv6 options causing the following bad memory access: $ build/test-dhcp6-client Assertion 'interface_index = -1' failed at ../src/libsystemd-network/sd-dhcp6-client.c:129, function sd_dhcp6_client_set_index().

[systemd-devel] [PATCH 0/8] Basic DHCPv6 client implementation

2014-06-26 Thread Patrik Flykt
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

[systemd-devel] [PATCH 3/8] networkd: Properly stop router solicitation and DHCPv6 client

2014-06-26 Thread Patrik Flykt
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

[systemd-devel] [PATCH 4/8] sd-dhcp6-client: Add Option Request Option support

2014-06-26 Thread Patrik Flykt
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|

[systemd-devel] [PATCH 5/8] sd-dhcp6-lease: Add helper function to compute remaining expiry time

2014-06-26 Thread Patrik Flykt
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. ---

[systemd-devel] [PATCH 2/8] sd-icmp6-nd: Add function to stop ongoing ICMPv6 discovery

2014-06-26 Thread Patrik Flykt
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

[systemd-devel] [PATCH 6/8] sd-dhcp6-client: Implement Renew and Rebind

2014-06-26 Thread Patrik Flykt
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

[systemd-devel] [PATCH 1/8] sd-dhcp6-client: return NULL from _unref() like the other sd-* libraries

2014-06-26 Thread Patrik Flykt
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

[systemd-devel] [PATCH 8/8] TODO: Add items for the DHCPv6 implementation

2014-06-26 Thread Patrik Flykt
--- 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

Re: [systemd-devel] [PATCH 4/8] sd-dhcp6-client: Add Option Request Option support

2014-06-26 Thread Patrik Flykt
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

Re: [systemd-devel] [PATCH 5/8] sd-dhcp6-lease: Add helper function to compute remaining expiry time

2014-06-26 Thread Patrik Flykt
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; +}

Re: [systemd-devel] [PATCH 5/8] sd-dhcp6-lease: Add helper function to compute remaining expiry time

2014-06-26 Thread Patrik Flykt
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

Re: [systemd-devel] [PATCH 0/8] Basic DHCPv6 client implementation

2014-06-26 Thread Patrik Flykt
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

Re: [systemd-devel] [PATCH 09/24] sd-dhcp6-client: Add DHCPv6 client Solicitation timeout handling

2014-06-19 Thread Patrik Flykt
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

Re: [systemd-devel] [PATCH 12/24] sd-dhcp6-client: Add DHCPv6 Solicit message creation and sending

2014-06-19 Thread Patrik Flykt
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) +

Re: [systemd-devel] [PATCH 02/24] sd-dhcp6-client: Add Router Solicitation and Advertisement support

2014-06-19 Thread Patrik Flykt
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

Re: [systemd-devel] [PATCH 02/24] sd-dhcp6-client: Add Router Solicitation and Advertisement support

2014-06-19 Thread Patrik Flykt
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,

Re: [systemd-devel] [PATCH 02/24] sd-dhcp6-client: Add Router Solicitation and Advertisement support

2014-06-16 Thread Patrik Flykt
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*,

[systemd-devel] [PATCH 03/24] sd-dhcp6-client: Add initial Router Advertisement test case

2014-06-13 Thread Patrik Flykt
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

[systemd-devel] [PATCH 04/24] sd-dhcp6-client: Initialize Router Solicitation on startup

2014-06-13 Thread Patrik Flykt
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

[systemd-devel] [PATCH 14/24] sd-dhcp6-lease: Add DHCPv6 lease handling

2014-06-13 Thread Patrik Flykt
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

[systemd-devel] [PATCH 11/24] sd-dhcp6-client: Add functions to bind to DHCPv6 UDP socket

2014-06-13 Thread Patrik Flykt
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,

[systemd-devel] [PATCH 09/24] sd-dhcp6-client: Add DHCPv6 client Solicitation timeout handling

2014-06-13 Thread Patrik Flykt
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

[systemd-devel] [PATCH 10/24] sd-dhcp6-client: Add basic DHCPv6 option handling

2014-06-13 Thread Patrik Flykt
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 +-

[systemd-devel] [PATCH 16/24] sd-dhcp6-client: Receive and parse Advertise messages

2014-06-13 Thread Patrik Flykt
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

[systemd-devel] [PATCH 20/24] sd-dhcp6-client: Add Request message sending

2014-06-13 Thread Patrik Flykt
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

[systemd-devel] [PATCH 13/24] sd-dhcp6-client: Add RA and DHCPv6 Solicit test case

2014-06-13 Thread Patrik Flykt
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 |

[systemd-devel] [PATCH 21/24] sd-dhcp6-client: Add Advertise sending for test cases

2014-06-13 Thread Patrik Flykt
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

[systemd-devel] [PATCH 18/24] sd-dhcp6-client: Add test case for Advertise message parsing

2014-06-13 Thread Patrik Flykt
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

[systemd-devel] [PATCH 01/24] sd-dhcp6-client: Add initial DHCPv6 client files

2014-06-13 Thread Patrik Flykt
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 +++

[systemd-devel] [PATCH 22/24] sd-dhcp6-client: Receive and parse a reply and set T1 and T2 timers

2014-06-13 Thread Patrik Flykt
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

[systemd-devel] [PATCH 15/24] sd-dhcp6-client: Add IA Address option parsing

2014-06-13 Thread Patrik Flykt
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.,

[systemd-devel] [PATCH 06/24] network-internal: split out net_get_name()

2014-06-13 Thread Patrik Flykt
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

  1   2   3   >