summaryrefslogtreecommitdiffhomepage
path: root/src/dhcpv6.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-12-10 15:56:41 +0100
committerSteven Barth <steven@midlink.org>2013-12-10 15:56:41 +0100
commit5df476f99b3254bfc26721452b17a5fc23e7142c (patch)
tree546400db61994a5a990fa32d56d168a124977110 /src/dhcpv6.c
parent3d84d7c0b5fa08068b4055c793e1cccd6e0e9ea3 (diff)
parent93a6018520bf3521a6e853e5ffbff827d33f96b9 (diff)
Merge branch 'master' of github.com:sbyx/odhcpd
Diffstat (limited to 'src/dhcpv6.c')
-rw-r--r--src/dhcpv6.c8
1 files changed, 6 insertions, 2 deletions
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);
}