e3169126793f43be3d840874ffb3935a51097001Patrik Flykt This file is part of systemd.
e3169126793f43be3d840874ffb3935a51097001Patrik Flykt Copyright (C) 2014 Intel Corporation. All rights reserved.
e3169126793f43be3d840874ffb3935a51097001Patrik Flykt systemd is free software; you can redistribute it and/or modify it
e3169126793f43be3d840874ffb3935a51097001Patrik Flykt under the terms of the GNU Lesser General Public License as published by
e3169126793f43be3d840874ffb3935a51097001Patrik Flykt the Free Software Foundation; either version 2.1 of the License, or
e3169126793f43be3d840874ffb3935a51097001Patrik Flykt (at your option) any later version.
e3169126793f43be3d840874ffb3935a51097001Patrik Flykt systemd is distributed in the hope that it will be useful, but
e3169126793f43be3d840874ffb3935a51097001Patrik Flykt WITHOUT ANY WARRANTY; without even the implied warranty of
e3169126793f43be3d840874ffb3935a51097001Patrik Flykt MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e3169126793f43be3d840874ffb3935a51097001Patrik Flykt Lesser General Public License for more details.
e3169126793f43be3d840874ffb3935a51097001Patrik Flykt You should have received a copy of the GNU Lesser General Public License
e3169126793f43be3d840874ffb3935a51097001Patrik Flykt along with systemd; If not, see <http://www.gnu.org/licenses/>.
34e8c5a23cd1c53ef3c1169388dabe1f6dfd7319Patrik Flyktint dhcp6_network_bind_udp_socket(int index, struct in6_addr *local_address) {
6506063f8f68f589040cfcc138d3f61269fb2a63Tom Gundersen s = socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, IPPROTO_UDP);
34e8c5a23cd1c53ef3c1169388dabe1f6dfd7319Patrik Flykt r = setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on));
34e8c5a23cd1c53ef3c1169388dabe1f6dfd7319Patrik Flykt r = setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &off, sizeof(off));
6506063f8f68f589040cfcc138d3f61269fb2a63Tom Gundersen r = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
34e8c5a23cd1c53ef3c1169388dabe1f6dfd7319Patrik Flyktint dhcp6_network_send_udp_socket(int s, struct in6_addr *server_address,
34e8c5a23cd1c53ef3c1169388dabe1f6dfd7319Patrik Flykt memcpy(&dest.in6.sin6_addr, server_address, sizeof(dest.in6.sin6_addr));
34e8c5a23cd1c53ef3c1169388dabe1f6dfd7319Patrik Flykt r = sendto(s, packet, len, 0, &dest.sa, sizeof(dest.in6));