If we encounter read errors reading the duid or iaid after successfully

opening the file, print an error and exit.
This commit is contained in:
Nicholas J. Kain 2014-04-06 06:06:53 -04:00
parent 7b0db5b8d3
commit 745e9e8923

View File

@ -175,6 +175,9 @@ void get_clientid(struct client_state_t *cs, struct client_config_t *cc)
cc->interface, __func__);
} else {
iaid_len = safe_read(fd, iaid, sizeof iaid);
if (iaid_len < 0)
suicide("%s: (%s) failed to read IAID from file",
cc->interface, __func__);
}
close(fd);
@ -188,6 +191,9 @@ void get_clientid(struct client_state_t *cs, struct client_config_t *cc)
cc->interface, __func__);
} else {
duid_len = safe_read(fd, duid, sizeof duid);
if (duid_len < 0)
suicide("%s: (%s) failed to read DUID from file",
cc->interface, __func__);
}
close(fd);