Commit graph

62 commits

Author SHA1 Message Date
Patrik Flykt e5b04c8de8 sd-dhcp-client: Add reference counting for DHCP
The DHCP library user can decide to free the DHCP client any time
the callback is called. After the callback has been called, other
computations may still be needed - the best example being a full
restart of the DHCP procedure in case of lease expiry.

Fix this by introducing proper reference counting. Properly handle
a returned NULL from the notify and stop functions if the DHCP
client was freed.
2014-04-11 10:53:10 +03:00
Tom Gundersen d47e1de40e sd-dhcp-client: test - fix for jenkins
This test should have been updated when changing the magic cookie handling around.

Reported by Ken MacLeod.
2014-04-10 17:08:32 +02:00
Zbigniew Jędrzejewski-Szmek c4acff1275 test-dhcp-client: style fixes 2014-04-07 21:02:47 -04:00
Tom Gundersen 7429b07f82 sd-dhcp-client: improve BPF
Try a bit harder to make the kernel drop packets not for us. This should reduce
the number of wakeups from n^2 to n in the number of dhcp clients, which admittedly
only makes a differenc in very extreme cases.
2014-04-06 19:42:11 +02:00
Lennart Poettering 6a0f1f6d5a sd-event: rework API to support CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM, too 2014-03-24 02:58:41 +01:00
Tom Gundersen 2afa65c312 sd-dhcp-client: test - don't close socket twice
One end of the socketpair is closed by the library, so only close our end. Also switch to
the safe_close() so we get notified about problems with closing.
2014-03-22 10:52:49 +01:00
Patrik Flykt d790d3f173 libsystemd-dhcp: Update client test case for client id and end option
Check that the client identifier is formatted as suggested in the
RFC and that the messages sent ends with an end option.
2014-03-20 10:56:29 +02:00
Patrik Flykt 8fc8e3ab98 libsystemd-network: Add hangcheck timer for DHCP client test 2014-03-19 10:52:40 +02:00
Patrik Flykt a838c939a3 libsystemd-network: Export checksum function to test case
Remove identical checksum function implementation from the test
case code.
2014-03-19 10:52:40 +02:00
Kay Sievers f937d3d662 test-dhcp-client: remove pointless initializer, wrongly committed earlier 2014-03-12 01:26:34 +01:00
Kay Sievers 4ef0809c22 build-sys: add libsystemd-label to network/dhcp users 2014-03-11 22:11:39 +01:00
Tom Gundersen fe8db0c5ee sd-network: add new library
This is similar to sd-login, but exposes the state of networkd rather than logind.

Include it in libsystemd-dhcp and rename it to libsystemd-network.
2014-02-28 01:01:13 +01:00
Renamed from src/libsystemd-dhcp/test-dhcp-client.c (Browse further)