summaryrefslogtreecommitdiffhomepage
path: root/src/odhcpd.c
diff options
context:
space:
mode:
authorHyeonsik Song <blogcin@naver.com>2018-07-05 10:45:37 +0900
committerHans Dedecker <dedeckeh@gmail.com>2018-07-05 11:40:43 +0200
commitc0f63905c74b3b0b168a9cf7903ebaec6564c24c (patch)
tree391aa51417c84e5f54a57597e7d2fad5a54f7fe0 /src/odhcpd.c
parent81a281e83d71c778ad1dab72721d07f0a129521d (diff)
odhcpd: Check if open the ioctl socket failed
Signed-off-by: Hyeonsik Song <blogcin@naver.com>
Diffstat (limited to 'src/odhcpd.c')
-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;