Bug 77850

Summary: systemd-network losing the DHCP leases on raspberry pi
Product: systemd Reporter: Kai Hendry <hendry>
Component: generalAssignee: systemd-bugs
Status: RESOLVED NOTOURBUG QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: ao, ijanos, john.gosset, maggu2810, radek
Version: unspecified   
Hardware: ARM   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: systemd-networkd.log
dhcp_systemd-networkd.pcap
dhcp_systemd-networkd.log
dhcp_dhcpcd.pcap
dhcp_dhcpcd.log

Comment 1 Zbigniew Jedrzejewski-Szmek 2014-04-24 02:50:12 UTC
Please try with systemd-networkd from latest git. (It's enough to just compile and copy the systemd-networkd binary). There have been many improvements since 212 release.
Comment 2 Markus Rathgeb 2014-05-19 14:03:34 UTC
Using recent systemd-networkd solved the problem on my machine.

Build it on ArchLinux by using the AUR systemd-git package (added arch=armv7h).
systemd-git-212.438.ga077b66-1-armv7h.pkg.tar.xz

Replaced files:
/usr/lib/systemd/systemd-networkd
/usr/lib/systemd/systemd-networkd-wait-online

I did not check whether it works without replace systemd-networkd-wait-online.

The rest of systemd is 212.
Comment 3 Kai Hendry 2014-05-20 08:15:16 UTC
Could you post your systemd-git-212.438.ga077b66-1-armv7h.pkg.tar.xz package some place? I give up compiling it on my rpi. The systemd deps are also a tad scary.
Comment 4 Markus Rathgeb 2014-05-20 08:59:14 UTC
systemd-git-212.438.ga077b66-1-armv7h.pkg.tar.xz
https://drive.google.com/file/d/0Bx99QXY8p6gvbDFJZHVkODh5U0U/edit?usp=sharing
Comment 5 Kai Hendry 2014-05-20 09:45:43 UTC
Oh, this isn't going to work for my rpi. Doh.
:: package systemd-git-212.438.ga077b66-1-armv7h does not have a valid architecture
Comment 6 Markus Rathgeb 2014-05-20 11:00:59 UTC
IMHO you need armv6l for your RPi.
Comment 7 Lennart Poettering 2014-05-24 06:48:18 UTC
Closing, since current git supposedly works fine.
Comment 8 John Gosset 2014-06-27 16:40:21 UTC
I'm having the same issue using systemd-214 (archlinuxarm package: systemd 214-2.1).

No DHCP issue when using dhcpcd.
Comment 9 Tom Gundersen 2014-06-30 22:25:27 UTC
Could anyone who can reproduce this do
SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd
so we can see the debug output.

A package dump of the DHCP packets would also be awesome :)
Comment 10 Markus Rathgeb 2014-07-01 09:02:27 UTC
Created attachment 102063 [details]
systemd-networkd.log

I logged the output (till I interrupted).

The expire time is a little bit low, right?
Comment 11 John Gosset 2014-07-02 13:27:51 UTC
Created attachment 102132 [details]
dhcp_systemd-networkd.pcap
Comment 12 John Gosset 2014-07-02 13:29:11 UTC
Created attachment 102133 [details]
dhcp_systemd-networkd.log
Comment 13 John Gosset 2014-07-02 13:30:07 UTC
Created attachment 102134 [details]
dhcp_dhcpcd.pcap
Comment 14 John Gosset 2014-07-02 13:30:35 UTC
Created attachment 102135 [details]
dhcp_dhcpcd.log
Comment 15 John Gosset 2014-07-02 13:33:58 UTC
Ask and ye shall receive...

I uploaded pcaps and logs from the DHCP conversation via systemd-networkd and dhcpcd for comparison.

I did:

tcpdump -i eth0 -w dhcp_systemd-networkd.pcap udp port 67
SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd

tcpdump -i eth0 -w dhcp_dhcpcd.pcap udp port 67
dhcpcd -d eth0
Comment 16 Fireball 2014-07-15 06:06:17 UTC
systemd 215 still has this bug :(
Comment 17 John Gosset 2014-07-17 22:32:47 UTC
This seems to have been fixed by upgrading to archlinuxarm's systemd-215-4.1 package.

Looks like the problem may have been caused by a compiler option downstream (-O2: bug, -O0: no bug).

Discussion:
https://bugs.freedesktop.org/show_bug.cgi?id=80582#c24
https://github.com/archlinuxarm/PKGBUILDs/issues/900

Marking as resolved.
Comment 18 Markus Rathgeb 2014-07-18 05:15:22 UTC
Ah, that explains why the problem did not occur if I compiled it myself (comment #2).

If an error (at runtime) is raised with -O2 and not with -O0 this could still be a bug in the code (e.g. access an element behind the last element of an array, ...) that is only hidden by different memory layouts.
Do you know at which statement the bug is raised?
Shouldn't -O2 be something that does not enable error prune compiler flags?

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.