X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fodhcpd.git;a=blobdiff_plain;f=src%2Fdhcpv6.c;h=7560a75bc961f7a44941a38f3ab92915c99786d6;hp=9515f40b3a8838eaeaa7f03d4320f4b2c5e5b9f8;hb=3fcc0814db3773e1295a372ea7a4194e19c62e52;hpb=8b19de666e02f24280728938dd985ecb3673b83e;ds=inline diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 9515f40..7560a75 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -40,6 +40,11 @@ static struct odhcpd_event dhcpv6_event = {{.fd = -1}, handle_dhcpv6}; int init_dhcpv6(void) { int sock = socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, IPPROTO_UDP); + if (sock < 0) { + syslog(LOG_ERR, "Failed to create DHCPv6 server socket: %s", + strerror(errno)); + return -1; + } // Basic IPv6 configuration int val = 1; @@ -91,8 +96,7 @@ int setup_dhcpv6_interface(struct interface *iface, bool enable) IPV6_ADD_MEMBERSHIP, &server, sizeof(server)); } - setup_dhcpv6_ia_interface(iface, enable); - return 0; + return setup_dhcpv6_ia_interface(iface, enable); }