summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHyeonsik Song2018-07-05 01:45:37 +0000
committerHans Dedecker2018-07-05 09:40:43 +0000
commitc0f63905c74b3b0b168a9cf7903ebaec6564c24c (patch)
tree391aa51417c84e5f54a57597e7d2fad5a54f7fe0
parent81a281e83d71c778ad1dab72721d07f0a129521d (diff)
downloadodhcpd-c0f63905c74b3b0b168a9cf7903ebaec6564c24c.tar.gz
odhcpd: Check if open the ioctl socket failed
Signed-off-by: Hyeonsik Song <blogcin@naver.com>
-rw-r--r--src/odhcpd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/odhcpd.c b/src/odhcpd.c
index 9ab849a..fe4dd73 100644
--- a/src/odhcpd.c
+++ b/src/odhcpd.c
@@ -91,6 +91,9 @@ int main(int argc, char **argv)
ioctl_sock = socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
+ if (ioctl_sock < 0)
+ return 4;
+
if ((urandom_fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC)) < 0)
return 4;