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 DNSConfigurat

[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 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. --- src/libsystemd-network/dhcp

[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 +++ src/libsystemd-network/sd-dhcp

[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 --- a/src/n

[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 b/src/libsystemd-network/sd-dhcp6-client

[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 insertions(+)

[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

[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 --- a/src/libs

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

2015-07-10 Thread Patrik Flykt
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 for

[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 a/src/libsystemd-

[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 done

[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 +++

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

2015-05-03 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,

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 act

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

[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 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 > no

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 re

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 > wrote: > > Expiring prefixes need not be handled anymore as the kernel has been > > instructed not to create routes for DHCPv6 assigned addresses via the > >

[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(-) di

[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 t

[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 bf7278f..5

[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

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 b

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 m

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

[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

[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 +++ b/src/libsyste

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

2015-01-20 Thread Patrik Flykt
values so received should be used in networkd. I'll update the test case verbosity in another patch later. The proposed log_link_warning_errno() I also delegated "for later", let's try to have the DHCPv6 address assignment done first. Please review, Patrik Patrik Flykt (

[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 - src/libsystemd-network/t

[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 merg

[systemd-devel] [PATCH v2 7/9] test-icmp6-nd: Add test cases for prefixes

2015-01-20 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. --- src/libsystemd-networ

[systemd-devel] [PATCH v2 2/9] sd-icmp6-nd: Update Router Advertisement handling

2015-01-20 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. --- v2: Address iteration fixed accordign to comments in v1,

[systemd-devel] [PATCH v2 6/9] sd-icmp6-nd: Parse ICMPv6 prefix information

2015-01-20 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, o

[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 i

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

2015-01-20 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 v

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 n

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

2015-01-14 Thread Patrik Flykt
On Wed, 2015-01-14 at 01:48 +0100, Zbigniew Jędrzejewski-Szmek wrote: > I replied to individual patches with some comments. Looks good > in general. Something has happened to my emacs indentation since last time, and I have to admit getting a bit rusty also... I'll update the patch set according

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 futur

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

[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 do

[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. --- src/libsystemd-networ

[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, o

[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 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 +++ b/src/libsy

[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 v

[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 +++ src/libsystemd-network

[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 a/src/libsystemd-network/sd-icmp6-nd.

[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 b/src/libsystemd-network/sd-icmp6-nd.

[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 to

[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 +++ b/src/libsystemd-network/sd-dhcp6-cl

[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 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 +--- src/network

[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 0/6] DHCPv6 Information request

2014-12-10 Thread Patrik Flykt
s procedure, i.e. "downgrading" 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

[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 sd_dhcp6_cl

[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 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. --- src/libsystemd-ne

[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 inse

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 client_message_init(

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.

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

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

2014-10-03 Thread Patrik Flykt
Hi, 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. > + necessary for delivery of DHCP

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 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 http://lists.freedesktop.org/mailman/listi

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

2014-09-01 Thread Patrik Flykt
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

[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 d102a79.

[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 and

[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 suppo

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

2014-08-28 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(). Ignoring

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,

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 systemd-devel@lists.freedesktop.or

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 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

[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 a/src/libsystemd-network/sd-d

[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 i

[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 f

[systemd-devel] [PATCH 7/8] sd-dhcp6-client: Implement Rapid Commit

2014-06-26 Thread Patrik Flykt
Add a Rapid Commit option to Solicit messages and expect a Reply to be received instead of an Advertise. When receiving a DHCPv6 message from the server in state Solicit, continue testing whether the message is a Reply. Ease up the message type checking, it's not fatal if the message is of a wrong

[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 o

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

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

[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 inde

[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| 12

[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. --- src/libsystemd-network/dhcp6-lease-inter

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! Chee

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 e

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 > > wrote: > > >> +if (client->fd > 0) > > >> +safe_close(client->f

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 { > > +

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

2014-06-18 Thread Patrik Flykt
On Mon, 2014-06-16 at 12:39 +0300, Patrik Flykt 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 > >

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 "u

[systemd-devel] [PATCH 23/24] sd-dhcp6-client: Add reply sending for test

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

[systemd-devel] [PATCH 05/24] sd-dhcp6-client: Initialize DUID

2014-06-13 Thread Patrik Flykt
From: Tom Gundersen 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-dhcp6-client.c

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

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

[systemd-devel] [PATCH 00/24] Initial DHCPv6 client support

2014-06-13 Thread Patrik Flykt
oroughly dissect the DHCPv6 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

[systemd-devel] [PATCH 08/24] sd-dhcp6-client: Add basic DHCPv6 test cases

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

[systemd-devel] [PATCH 19/24] sd-dhcp6-client: Update start function to take a state

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

  1   2   3   >