networkd-dhcp6.c revision e53fc357a9bb9d0a5362ccc4246d598cb0febd5e
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright (C) 2014 Intel Corporation. All rights reserved.
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "networkd-link.h"
#include "network-internal.h"
#include "sd-icmp6-nd.h"
#include "sd-dhcp6-client.h"
return 0;
}
void *userdata) {
int r;
r = sd_netlink_message_get_errno(m);
if (r < 0 && r != -EEXIST) {
if (link->rtnl_extended_attrs) {
log_link_warning(link, "Could not set extended netlink attributes, reverting to fallback mechanism");
link->rtnl_extended_attrs = false;
return 1;
}
} else if (r >= 0)
return 1;
}
int r;
r = address_new_dynamic(&addr);
if (r < 0)
return r;
if (r < 0)
return r;
}
int r;
if (r < 0)
return r;
&lifetime_valid) >= 0) {
if (r < 0 && r != -EADDRNOTAVAIL) {
return r;
}
if (r == -EADDRNOTAVAIL)
prefixlen = 128;
if (r < 0)
return r;
}
return 0;
}
int r;
return;
switch(event) {
link->dhcp6_configured = false;
break;
if (r < 0) {
return;
}
/* fall through */
if (r < 0) {
return;
}
link->dhcp6_configured = true;
break;
default:
if (event < 0)
else
return;
}
}
int r;
bool information_request;
link->dhcp6_configured = false;
if (link->dhcp6_client) {
if (r < 0) {
goto error;
}
if (r < 0) {
goto error;
}
false);
if (r < 0) {
goto error;
}
}
if (r < 0 && r != -EALREADY) {
goto error;
}
if (r == -EALREADY)
link->dhcp6_configured = true;
return r;
}
if (r < 0)
goto error;
if (r < 0)
goto error;
if (r < 0)
goto error;
if (r < 0)
goto error;
link);
if (r < 0)
goto error;
true);
if (r < 0)
goto error;
}
if (r < 0)
goto error;
return r;
return r;
}
int r;
if (r < 0)
return r;
if (r < 0)
return r;
&lifetime_valid) >= 0) {
&ip6_addr);
if (r < 0)
continue;
log_link_info(link, "IPv6 prefix length updated "SD_ICMP6_ND_ADDRESS_FORMAT_STR"/%d", SD_ICMP6_ND_ADDRESS_FORMAT_VAL(ip6_addr), 128);
}
return 0;
}
return;
switch(event) {
return;
break;
if (!link->rtnl_extended_attrs)
break;
default:
if (event < 0)
else
break;
}
}
int r;
if (r < 0)
return r;
if (r < 0)
return r;
if (r < 0)
return r;
if (r < 0)
return r;
return r;
}