ipaccess-config: Handle setsockopt return value

Change-Id: I8c2082f9a9c865cc663ad2abb63ee0f70914dabe
Fixes: Coverity CID 57640
This commit is contained in:
Harald Welte 2016-11-26 14:06:52 +01:00
parent 18712f0bd1
commit 54f44ec585
1 changed files with 6 additions and 1 deletions

View File

@ -108,7 +108,12 @@ static int ipaccess_connect(struct e1inp_line *line, struct sockaddr_in *sa)
return -EIO;
}
setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
ret = setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
if (ret < 0) {
LOGP(DLINP, LOGL_ERROR, "could not set socket option\n");
close(bfd->fd);
return -EIO;
}
ret = connect(bfd->fd, (struct sockaddr *) sa, sizeof(*sa));
if (ret < 0) {