test-dhcp6-client.c revision 5e256ea7d3d556b3a1fb5c1faa94ec6a8833e53e
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek This file is part of systemd.
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek Copyright (C) 2014 Intel Corporation. All rights reserved.
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek systemd is free software; you can redistribute it and/or modify it
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek under the terms of the GNU Lesser General Public License as published by
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek the Free Software Foundation; either version 2.1 of the License, or
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek (at your option) any later version.
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek systemd is distributed in the hope that it will be useful, but
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek WITHOUT ANY WARRANTY; without even the implied warranty of
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek Lesser General Public License for more details.
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek You should have received a copy of the GNU Lesser General Public License
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek along with systemd; If not, see <http://www.gnu.org/licenses/>.
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek#include "dhcp6-lease-internal.h"
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmekstatic struct ether_addr mac_addr = {
892213bf1fd23e48d64a407ece6e10b07bef1926Zbigniew Jędrzejewski-Szmek .ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'}
30374ebe5e9f0b37e99dcbdc965c00fcf542f89dLennart Poetteringstatic bool verbose = false;
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmekstatic int test_client_message_num;
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmekstatic uint8_t test_duid[14] = { };
603938e0a9b5379984d7397e3cf81683c0037a53Lennart Poetteringstatic int test_client_basic(sd_event *e) {
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(sd_dhcp6_client_new(&client) >= 0);
30374ebe5e9f0b37e99dcbdc965c00fcf542f89dLennart Poettering assert_se(sd_dhcp6_client_attach_event(client, e, 0) >= 0);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(sd_dhcp6_client_set_index(client, 15) == 0);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(sd_dhcp6_client_set_index(client, -42) == -EINVAL);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(sd_dhcp6_client_set_index(client, -1) == 0);
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5Michal Schmidt assert_se(sd_dhcp6_client_set_index(client, 42) >= 0);
30374ebe5e9f0b37e99dcbdc965c00fcf542f89dLennart Poettering assert_se(sd_dhcp6_client_set_mac(client, &mac_addr) >= 0);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(sd_dhcp6_client_set_callback(client, NULL, NULL) >= 0);
30374ebe5e9f0b37e99dcbdc965c00fcf542f89dLennart Poettering assert_se(sd_dhcp6_client_detach_event(client) >= 0);
30374ebe5e9f0b37e99dcbdc965c00fcf542f89dLennart Poettering assert_se(!sd_dhcp6_client_unref(client));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmekstatic int test_option(sd_event *e) {
c099716487df4a4f5394e57e7ca14da1d358166aZbigniew Jędrzejewski-Szmek 0x00, DHCP6_OPTION_ORO, 0x00, 0x07,
c099716487df4a4f5394e57e7ca14da1d358166aZbigniew Jędrzejewski-Szmek 'A', 'B', 'C', 'D', 'E', 'F', 'G',
c099716487df4a4f5394e57e7ca14da1d358166aZbigniew Jędrzejewski-Szmek 0x00, DHCP6_OPTION_VENDOR_CLASS, 0x00, 0x09,
c099716487df4a4f5394e57e7ca14da1d358166aZbigniew Jędrzejewski-Szmek '1', '2', '3', '4', '5', '6', '7', '8', '9',
c099716487df4a4f5394e57e7ca14da1d358166aZbigniew Jędrzejewski-Szmek 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
c099716487df4a4f5394e57e7ca14da1d358166aZbigniew Jędrzejewski-Szmek 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
fff40a51ccbb02e8dec4ff2ee505bc84f75e445cZbigniew Jędrzejewski-Szmek 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
e0aa3726103448097e5ad7cc6f427e142103a321Zbigniew Jędrzejewski-Szmek size_t buflen = sizeof(packet), outlen = sizeof(result);
175a3d25d0e8596d4ba0759aea3f89ee228e7d6dLennart Poettering assert_se(dhcp6_option_parse(&buf, &zero, &optcode, &optlen,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(dhcp6_option_parse(&buf, &buflen, &optcode, &optlen,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(optcode == DHCP6_OPTION_ORO);
30374ebe5e9f0b37e99dcbdc965c00fcf542f89dLennart Poettering assert_se(buflen + pos == sizeof(packet));
30374ebe5e9f0b37e99dcbdc965c00fcf542f89dLennart Poettering assert_se(dhcp6_option_append(&out, &outlen, optcode, optlen,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(dhcp6_option_parse(&buf, &buflen, &optcode, &optlen,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(optcode == DHCP6_OPTION_VENDOR_CLASS);
23ea3dab15181a3966ec45fa2ccbb81e59d2e0a7Zbigniew Jędrzejewski-Szmek assert_se(buflen + pos == sizeof(packet));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(dhcp6_option_append(&out, &outlen, optcode, optlen,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(memcmp(packet, result, sizeof(packet)) == 0);
30374ebe5e9f0b37e99dcbdc965c00fcf542f89dLennart Poettering 0x02, 0x0f, 0xb4, 0xe5, 0x00, 0x01, 0x00, 0x0e,
30374ebe5e9f0b37e99dcbdc965c00fcf542f89dLennart Poettering 0x00, 0x01, 0x00, 0x01, 0x1a, 0x6b, 0xf3, 0x30,
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek 0x3c, 0x97, 0x0e, 0xcf, 0xa3, 0x7d, 0x00, 0x03,
892213bf1fd23e48d64a407ece6e10b07bef1926Zbigniew Jędrzejewski-Szmek 0x00, 0x5e, 0x0e, 0xcf, 0xa3, 0x7d, 0x00, 0x00,
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek 0x00, 0x50, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05,
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek 0x00, 0x18, 0x20, 0x01, 0x0d, 0xb8, 0xde, 0xad,
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek 0xbe, 0xef, 0x78, 0xee, 0x1c, 0xf3, 0x09, 0x3c,
7fd1b19bc9e9f5574f2877936b8ac267c7706947Harald Hoyer 0x55, 0xad, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00,
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek 0x00, 0xb4, 0x00, 0x0d, 0x00, 0x32, 0x00, 0x00,
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x28,
23ea3dab15181a3966ec45fa2ccbb81e59d2e0a7Zbigniew Jędrzejewski-Szmek 0x65, 0x73, 0x29, 0x20, 0x72, 0x65, 0x6e, 0x65,
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek 0x77, 0x65, 0x64, 0x2e, 0x20, 0x47, 0x72, 0x65,
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek 0x65, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x66,
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek 0x72, 0x6f, 0x6d, 0x20, 0x70, 0x6c, 0x61, 0x6e,
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek 0x65, 0x74, 0x20, 0x45, 0x61, 0x72, 0x74, 0x68,
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek 0x00, 0x17, 0x00, 0x10, 0x20, 0x01, 0x0d, 0xb8,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek 0xde, 0xad, 0xbe, 0xef, 0x00, 0x00, 0x00, 0x00,
23ea3dab15181a3966ec45fa2ccbb81e59d2e0a7Zbigniew Jędrzejewski-Szmek 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x0b,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek 0x03, 0x6c, 0x61, 0x62, 0x05, 0x69, 0x6e, 0x74,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek 0x72, 0x61, 0x00, 0x00, 0x1f, 0x00, 0x10, 0x20,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek 0x01, 0x0d, 0xb8, 0xde, 0xad, 0xbe, 0xef, 0x00,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek 0x02, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x19,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek 0x40, 0x5c, 0x53, 0x78, 0x2b, 0xcb, 0xb3, 0x6d,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek 0x53, 0x00, 0x07, 0x00, 0x01, 0x00
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmekstatic int test_advertise_option(sd_event *e) {
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek _cleanup_dhcp6_lease_free_ sd_dhcp6_lease *lease = NULL;
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek DHCP6Message *advertise = (DHCP6Message *)msg_advertise;
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek uint8_t *optval, *opt = &msg_advertise[sizeof(DHCP6Message)];
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek size_t optlen, len = sizeof(msg_advertise);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(dhcp6_lease_new(&lease) >= 0);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(advertise->type == DHCP6_ADVERTISE);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se((be32toh(advertise->transaction_id) & 0x00ffffff) ==
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek while ((r = dhcp6_option_parse(&opt, &len, &optcode, &optlen,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(optval, &msg_advertise[26], optlen));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(optval, &val, sizeof(val)));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(optval + 4, &val, sizeof(val)));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(optval + 8, &val, sizeof(val)));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(dhcp6_option_parse_ia(&optval, &optlen,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(optval, &msg_advertise[179], optlen));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(dhcp6_lease_set_serverid(lease, optval,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(dhcp6_lease_set_preference(lease,
30374ebe5e9f0b37e99dcbdc965c00fcf542f89dLennart Poettering assert_se(sd_dhcp6_lease_get_first_address(lease, &addr, <_pref,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(&addr, &msg_advertise[42], sizeof(addr)));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(sd_dhcp6_lease_get_next_address(lease, &addr, <_pref,
9d458c0902cdc5d993fd2f78d36fb83a8130c81bLennart Poettering assert_se(sd_dhcp6_lease_get_first_address(lease, &addr, <_pref,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(&addr, &msg_advertise[42], sizeof(addr)));
e9c1ea9de87d4d508ac38ce87a2fa56e7529a91aJason St. John assert_se(sd_dhcp6_lease_get_next_address(lease, &addr, <_pref,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(sd_dhcp6_lease_get_next_address(lease, &addr, <_pref,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(sd_dhcp6_lease_get_first_address(lease, &addr, <_pref,
c099716487df4a4f5394e57e7ca14da1d358166aZbigniew Jędrzejewski-Szmek assert_se(!memcmp(&addr, &msg_advertise[42], sizeof(addr)));
c099716487df4a4f5394e57e7ca14da1d358166aZbigniew Jędrzejewski-Szmek assert_se(sd_dhcp6_lease_get_next_address(lease, &addr, <_pref,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(dhcp6_lease_get_serverid(lease, &opt, &len) >= 0);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(opt, &msg_advertise[179], len));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(dhcp6_lease_get_preference(lease, &preference) >= 0);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmekstatic int test_hangcheck(sd_event_source *s, uint64_t usec, void *userdata) {
892213bf1fd23e48d64a407ece6e10b07bef1926Zbigniew Jędrzejewski-Szmek assert_not_reached("Test case should have completed in 2 seconds");
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmekint detect_container(const char **id) {
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmekint detect_virtualization(const char **id) {
892213bf1fd23e48d64a407ece6e10b07bef1926Zbigniew Jędrzejewski-Szmekint dhcp6_network_bind_udp_socket(int index, struct in6_addr *local_address) {
892213bf1fd23e48d64a407ece6e10b07bef1926Zbigniew Jędrzejewski-Szmek if (socketpair(AF_UNIX, SOCK_STREAM, 0, test_dhcp_fd) < 0)
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmekstatic int test_client_send_reply(DHCP6Message *request) {
ed6556920c1a6cdfe0bb04e806bc1f54ea191545Mantas Mikulėnasstatic int test_client_verify_request(DHCP6Message *request, uint8_t *option,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek _cleanup_dhcp6_lease_free_ sd_dhcp6_lease *lease = NULL;
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek bool found_clientid = false, found_iana = false, found_serverid = false;
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(request->type == DHCP6_REQUEST);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(dhcp6_lease_new(&lease) >= 0);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek while ((r = dhcp6_option_parse(&option, &len,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek &optcode, &optlen, &optval)) >= 0) {
5e65c93a433447b15180249166f7b3944c3e6156Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(optval, &test_duid,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(optval, &test_iaid, sizeof(test_iaid)));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(optval + 4, &val, sizeof(val)));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(optval + 8, &val, sizeof(val)));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!dhcp6_option_parse_ia(&optval, &optlen,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(&msg_advertise[179], optval, optlen));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(found_clientid && found_iana && found_serverid);
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(sd_dhcp6_lease_get_first_address(lease, &addr, <_pref,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(!memcmp(&addr, &msg_advertise[42], sizeof(addr)));
2c408cb6276e3b8d18fb4e2a81a1128d8bbaa70dLennart Poettering assert_se(sd_dhcp6_lease_get_next_address(lease, &addr, <_pref,
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmekstatic int test_client_send_advertise(DHCP6Message *solicit)
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek advertise.transaction_id = solicit->transaction_id;
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek advertise.type = DHCP6_ADVERTISE;
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek memcpy(msg_advertise, &advertise.transaction_id, 4);
2c408cb6276e3b8d18fb4e2a81a1128d8bbaa70dLennart Poettering memcpy(&msg_advertise[8], test_duid, sizeof(test_duid));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek memcpy(&msg_advertise[26], &test_iaid, sizeof(test_iaid));
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmek assert_se(write(test_dhcp_fd[1], msg_advertise, sizeof(msg_advertise))
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0Zbigniew Jędrzejewski-Szmekstatic int test_client_verify_solicit(DHCP6Message *solicit, uint8_t *option,
switch(optcode) {
case DHCP6_OPTION_CLIENTID:
found_clientid = true;
case DHCP6_OPTION_IA_NA:
found_iana = true;
if (test_client_message_num == 0) {
return len;
void *userdata) {
assert_se(e);
if (verbose)
sd_event_exit(e, 0);
if (verbose)
test_client_solicit_cb, e) >= 0);
e_solicit = e;
sd_event_loop(e);
log_open();
test_option(e);