summaryrefslogtreecommitdiffhomepage
path: root/src/ndp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ndp.c')
-rw-r--r--src/ndp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ndp.c b/src/ndp.c
index e006c85..17ec8b4 100644
--- a/src/ndp.c
+++ b/src/ndp.c
@@ -111,6 +111,10 @@ int init_ndp(void)
// Open ICMPv6 socket
ping_socket = socket(AF_INET6, SOCK_RAW | SOCK_CLOEXEC, IPPROTO_ICMPV6);
+ if (ping_socket < 0) {
+ syslog(LOG_ERR, "Unable to open raw socket: %s", strerror(errno));
+ return -1;
+ }
int val = 2;
setsockopt(ping_socket, IPPROTO_RAW, IPV6_CHECKSUM, &val, sizeof(val));