summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/test-dhcp6-client.c
AgeCommit message (Collapse)Author
2015-01-27sd-dhcp6-lease: Revise address iteration functionsPatrik 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.
2014-12-10test-dhcp6-client: Add a simple Information Request test casePatrik 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.
2014-10-11sd-dhcp-client: support non-Ethernet hardware addressesDan Williams
Like Infiniband. See RFC 4390 section 2.1 for details on DHCP and Infiniband; chaddr is zeroed, hlen is set to 0, and htype is set to ARPHRD_INFINIBAND because IB hardware addresses are 20 bytes in length.
2014-09-10test-dhcp6-client: Add checks for Elapsed Time optionPatrik Flykt
Verify that the Elapsed Time option is present.
2014-08-30sd-dhcp6-client: properly calculate buffer size when parsing optionsZbigniew Jędrzejewski-Szmek
Also make pointer calculations more explicit so they are easier to understand.
2014-08-30test-dhcp6-client: Fix option lengthPatrik 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. ================================================================= ==29135==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7fe204aa9148 at pc 0x7fe204a5958f bp 0x7fff3e47d470 sp 0x7fff3e47d460 READ of size 1 at 0x7fe204aa9148 thread T0 #0 0x7fe204a5958e in option_parse_hdr ../src/libsystemd-network/dhcp6-option.c:145 #1 0x7fe204a59884 in dhcp6_option_parse ../src/libsystemd-network/dhcp6-option.c:165 #2 0x7fe204a4eb9c in test_advertise_option ../src/libsystemd-network/test-dhcp6-client.c:227 #3 0x7fe204a51c58 in main ../src/libsystemd-network/test-dhcp6-client.c:584 #4 0x7fe2031590df in __libc_start_main (/lib64/libc.so.6+0x200df) #5 0x7fe204a4cc5b (/home/test/systemd/build/test-dhcp6-client+0x25c5b) 0x7fe204aa9148 is located 2 bytes to the right of global variable 'msg_advertise' from '../src/libsystemd-network/test-dhcp6-client.c' (0x7fe204aa9080) of size 198 0x7fe204aa9148 is located 56 bytes to the left of global variable 'msg_reply' from '../src/libsystemd-network/test-dhcp6-client.c' (0x7fe204aa9180) of size 173 SUMMARY: AddressSanitizer: global-buffer-overflow ../src/libsystemd-network/dhcp6-option.c:145 option_parse_hdr
2014-07-24libsystemd-network: use CLOCK_BOOTTIME instead of CLOCK_MONOTONIC where possibleTom Gundersen
The timeouts in the networking library (DHCP lease timeouts and similar) should not be affected by suspend. In the cases where CLOCK_BOOTTIME is not implemented, it is still safe to fallback to CLOCK_MONOTONIC, as the consumers of the library (i.e., networkd) _should_ renew the leases when coming out of suspend.
2014-06-26sd-dhcp6-client: Add Option Request Option supportPatrik 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.
2014-06-19sd-dhcp6-client: Add reply sending for testPatrik 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.
2014-06-19sd-dhcp6-client: Add Advertise sending for test casePatrik 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.
2014-06-19sd-dhcp6-client: Add test case for Advertise message parsingPatrik 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 correctly.
2014-06-19sd-dhcp6-client: Add DHCPv6 Solicit test casePatrik Flykt
Verify the Solicit message created by the DHCPv6 client code. Provide local variants for detect_vm(), detect_container() and detect_virtualization() defined in virt.h. This makes the DHCPv6 library believe it is run in a container and does not try to request interface information from udev for the non-existing interface index used by the test case code.
2014-06-19sd-dhcp6-client: Add basic DHCPv6 option handlingPatrik 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.
2014-06-19sd-dhcp6-client: Add basic DHCPv6 test casesPatrik Flykt
Add test cases for basic DHCPv6 client handling, e.g. setting interface index, mac address and attaching event loop.