From: Hyeonsik Song Date: Thu, 5 Jul 2018 01:45:37 +0000 (+0900) Subject: odhcpd: Check if open the ioctl socket failed X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c0f63905c74b3b0b168a9cf7903ebaec6564c24c;p=project%2Fodhcpd.git odhcpd: Check if open the ioctl socket failed Signed-off-by: Hyeonsik Song --- 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;